Hi,
I'd like to draw attention to update_only -- the current
implementation of set_restricted creates some unexpected behavior.
So assume you have a model with attributes id, field1, and field2,
with id being the pk. If you have a hash that's {"id" => 3, "field1"
=> "foo", "field2" => "bar"}, and you say my_model.update_only
(the_hash, "field1"), then you'll get a "method id= doesn't exist or
access is restricted to it" if strict is enabled, which appears to be
by default.
The current doc describes update_only this way: "Update the values
using the entries in the hash, only if the key is included in only."
Does this make any sense? If I say "only update these fields" then
presumably it should only be updating those fields, right? It doesn't
seem logical to me that I say "only update these fields" and then it
throws an error trying to update a field I didn't specify.
Thanks,
Max
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" 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/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---