module ActiveRecord::Core::ClassMethods

Public Instance Methods

===(object) Show source
# File activerecord/lib/active_record/core.rb, line 244
def ===(object)
  object.is_a?(self)
end

Overwrite the default class equality method to provide support for association proxies.

allocate() Show source
# File activerecord/lib/active_record/core.rb, line 133
def allocate
  define_attribute_methods
  super
end
Calls superclass method
generated_association_methods() Show source
# File activerecord/lib/active_record/core.rb, line 219
def generated_association_methods
  @generated_association_methods ||= begin
    mod = const_set(:GeneratedAssociationMethods, Module.new)
    include mod
    mod
  end
end
inspect() Show source
# File activerecord/lib/active_record/core.rb, line 228
def inspect
  if self == Base
    super
  elsif abstract_class?
    "#{super}(abstract)"
  elsif !connected?
    "#{super} (call '#{super}.connection' to establish a connection)"
  elsif table_exists?
    attr_list = attribute_types.map { |name, type| "#{name}: #{type.type}" } * ', '
    "#{super}(#{attr_list})"
  else
    "#{super}(Table doesn't exist)"
  end
end

Returns a string like 'Post(id:integer, title:string, body:text)'

Calls superclass method

© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.