Skip to content

Instantly share code, notes, and snippets.

@creich
Created October 30, 2012 14:27
Show Gist options
  • Save creich/3980485 to your computer and use it in GitHub Desktop.
Save creich/3980485 to your computer and use it in GitHub Desktop.
t = Test.new
t.foo = "new value"
t.changed? # <== this one should be true!
# t.changed should be like ['foo']
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