datamapper / dm-types

DataMapper plugin providing extra data types
http://datamapper.org/
MIT License
55 stars 80 forks source link

ParanoidBoolean causes issues with belongs_to Relationships #52

Open pnomolos opened 12 years ago

pnomolos commented 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

pnomolos commented 12 years ago

To follow up: This only presents with existing records pulled from the datastore. Creating new records will result in correctly formed relationships.