Here is an example:

class User

  include DataMapper::Resource

  property :id, Serial
  property :email, String, :required => true, :unique => true,
            :format => :email_address
  property :deleted_ts, ParanoidDateTime
  property :deleted, ParanoidBoolean, :default => false

end

class Item

  include DataMapper::Resource

  property :id, Serial
  property :deleted_ts, ParanoidDateTime
  property :deleted, ParanoidBoolean, :default => false

  belongs_to :user
end

I then create a user association with the item:

user = User.create(:email => 'test.gmail.com')
item = Item.new
item.user = user
item.save

When I try to retrieve the item, the user association is nil:

item = Item.get(1)
user = item.user
user => nil

Like I said before, this only happens if I use ParanoidBoolean.  If I
just use ParanoidDateTime, everything works fine.

On Aug 3, 1:26 pm, Rip the Jacker <[email protected]> wrote:
> Can you post an example? I haven't experienced this problem.
>
> On Aug 2, 10:49 pm, Paul <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I am testing Datamapper 1.1.0 with Rails 3 and I noticed that for any
> > data models that have ParanoidBoolean types, their associations are
> > semi-broken.  By semi-broken, i mean you cannot retrieve any
> > belongs_to associations or has 1 associations.  ParanoidDateTime seems
> > to be working, on the other hand.  It took me a while to figure this
> > out.  Just wondering whether anyone notices this issue or whether the
> > folks at DataMapper is aware of it.
>
> > Thanks,
>
> > Paul

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to