ActiveRecord DangerousAttributeError: changed? is defined by ActiveRecord

on under asbach
1 minute read

Out Of Date Warning

This article was published on 18/10/2011, this means the content may be out of date or no longer relevant.
You should verify that the technical information in this article is still up to date before relying upon it for your own purposes.

ActiveRecord::DangerousAttributeError: changed?

Columns named changed or valid causes this exception. To change that:

class Node < ActiveRecord::Base
  def self.instance_method_already_implemented?(method_name)
    return true if method_name == 'changed'
    return true if method_name == 'changed?'
    super
  end

end

But note, that this will influence the functionality of ActiveRecord (without changed? the API can’t distinguish, if the model was changed or is valid etc.).


Reposted from notes.it-jobs-und-stellen.de