Created
October 30, 2012 14:27
-
-
Save creich/3980485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Test.new | |
t.foo = "new value" | |
t.changed? # <== this one should be true! | |
# t.changed should be like ['foo'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test < ActiveRecord::Base | |
attr_accessible :foo, :bar | |
belongs_to :b | |
def foo=(x) | |
b.update_attribute(:foo, x) | |
end | |
end | |
class B < ActiveRecord::Base | |
attr_accessible :foo | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment