Open pnomolos opened 12 years ago
class Car include DataMapper::Resource has n, :wheels property :id, Serial property :deleted, ParanoidBoolean, :default => false, :lazy => false end
If :lazy is set to true, Wheel.car will return nil even if a record exists (it even queries the DB successfully).
See https://gist.github.com/1511964 for a fuller use-case
To follow up: This only presents with existing records pulled from the datastore. Creating new records will result in correctly formed relationships.
class Car include DataMapper::Resource has n, :wheels property :id, Serial property :deleted, ParanoidBoolean, :default => false, :lazy => false end
If :lazy is set to true, Wheel.car will return nil even if a record exists (it even queries the DB successfully).
See https://gist.github.com/1511964 for a fuller use-case