Namespace
Methods
E
G
V
Constants
Point = Struct.new(:x, :y)
 
UnknownAttributeError = ActiveModel::UnknownAttributeError
 

Raised when unknown attributes are supplied via mass assignment.

class Person
  include ActiveModel::AttributeAssignment
  include ActiveModel::Validations
end

person = Person.new
person.assign_attributes(name: 'Gorby')
# => ActiveModel::UnknownAttributeError: unknown attribute 'name' for Person.
MigrationProxy = Struct.new(:name, :version, :filename, :scope) do def initialize(name, version, filename, scope) super @migration = nil end def basename File.basename(filename) end def mtime File.mtime filename end delegate :migrate, :announce, :write, :disable_ddl_transaction, to: :migration private def migration @migration ||= load_migration end def load_migration require(File.expand_path(filename)) name.constantize.new(name, version) end end
 

MigrationProxy is used to defer loading of the actual migration classes until they are needed

ADAPTERS_TASKS = { mysql2: :mysql_tasks, postgresql: :postgresql_tasks, sqlite3: :sqlite_tasks }
 
Class Public methods
eager_load!()
    # File activerecord/lib/active_record.rb
175 def self.eager_load!
176   super
177   ActiveRecord::Locking.eager_load!
178   ActiveRecord::Scoping.eager_load!
179   ActiveRecord::Associations.eager_load!
180   ActiveRecord::AttributeMethods.eager_load!
181   ActiveRecord::ConnectionAdapters.eager_load!
182 end
gem_version()

Returns the version of the currently loaded Active Record as a Gem::Version

  # File activerecord/lib/active_record/gem_version.rb
5 def self.gem_version
6   Gem::Version.new VERSION::STRING
7 end
version()

Returns the version of the currently loaded ActiveRecord as a Gem::Version

  # File activerecord/lib/active_record/version.rb
7 def self.version
8   gem_version
9 end