>> I've not really looked into this at all, but I thought you could
>> declare datamapper properties as private or protected to achieve
>> similar functionality to activerecord's  attr_protected
>> functionality....
>>
>> property :secret, :private => true
>> property :login, :protected => true
>>
>> As I say I've no idea if this is actually so or exactly what these
>> options do but it could be worth looking into if you are after this
>> type of behavior
>>
>
> You're probably thinking of :accessor => :private/:protected.  This
> just changes the ruby accessor.  Theoretically, I could do
>
> property :admin, :protected => true
>
> Then use user.send(...) when I wanted to set it.  That sucks though.

but you could add a public method to your model

def admin=(admin)
  @admin = admin
end

which would mean you could set it manually without using send.  But
having just had a wee play with it, it's not gong to do what you want
anyway as when you try and mass assign something that you've set as
private then (no surprise really I guess) it throws an exception
rather than just ignoring that property assignment and carrying on :(

sob

Rupert

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to