-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Hi,
I've started working with your awesome Mongoid on Rails3beta3 and Ruby 1.9.2-head. Today I built up my db, create and delete records, the problems comes when I've to update a record like this:
p = Person.first
p.update_attributes(:name => "John")
(it returns true)
When I recall Person.first the object wasn't updated and nothing happened in the log.
So I try to dig into your code to find out a solution.
To solve this problem I modified a method in Attributes module, I paste it here:
def process(attrs = nil)
(attrs || {}).each_pair do |key, value|
if set_allowed?(key)
modify(key.to_s, @attributes[key.to_s], value)
@attributes[key.to_s] = value
elsif write_allowed?(key)
modify(key.to_s, @attributes[key.to_s], send("#
=", value))
end
end
setup_modifications
end
Let me know if I made some mistakes or if you like it.
Bye
Giacomo