Flowdock
method

attribute_method?

Importance_1
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ActiveRecord::AttributeMethods::ClassMethods
attribute_method?(attribute) public

Returns true if attribute is an attribute method and table exists, false otherwise.

class Person < ActiveRecord::Base
end

Person.attribute_method?('name')   # => true
Person.attribute_method?(:age=)    # => true
Person.attribute_method?(:nothing) # => false
Show source
Register or log in to add new notes.