Tracking model changes in after_commit :on => :create callback
You can't use the rails changed?
method, as it will always return false. To track changes after the transaction is committed, use the previous_changes
method. It will return a hash with attribute name as key. You can can then check if your attribute_name is in the hash:
after_commit :foo
def foo
if previous_changes[attribute_name]
#do your task
end
end