Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

ParanoidBoolean causes issues with belongs_to Relationships #52

Open
pnomolos opened this issue Dec 22, 2011 · 1 comment
Open

ParanoidBoolean causes issues with belongs_to Relationships #52

pnomolos opened this issue Dec 22, 2011 · 1 comment

Comments

@pnomolos
Copy link

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant