Module ActiveRecord::AttributeMethods::ClassMethods
In: lib/active_record/attribute_methods.rb

Methods

Public Instance methods

Returns an array of column names as strings if it‘s not an abstract class and table exists. Otherwise it returns an empty array.

A method name is ‘dangerous’ if it is already defined by Active Record, but not by any ancestors. (So ‘puts’ is not dangerous but ‘save’ is.)

Generates all the attribute related methods for columns in the database accessors, mutators and query methods.

We will define the methods as instance methods, but will call them as singleton methods. This allows us to use method_defined? to check if the method exists, which is fast and won‘t give any false positives from the ancestors (because there are no ancestors).

[Validate]