1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

11 commits

Author SHA1 Message Date
beerlington
d0aebd5357 Refactor ActiveRecord::Inheritance.base_class logic
Moved logic from class_of_active_record_descendant(class) to the
base_class method. This method was confusing because it required
an argument, but that argument was 'self'.

Moved base_class tests to inheritance_test.rb and added some test
coverage for some untested cases.
2012-07-26 13:46:49 -04:00
Jon Leighton
e030f26ad3 Simplify AR configuration code.
Get rid of ActiveModel::Configuration, make better use of
ActiveSupport::Concern + class_attribute, etc.
2012-06-15 19:15:36 +01:00
Joe Goggins
65a3020851 Adding documentation for ActiveRecord::Base.abstract_class to clarify a particular usecase for this feature (to allow you to use inheritance in ActiveRecord without using the STI table name 2012-03-22 10:02:08 -05:00
Carlos Antonio da Silva
a8dd21d8b4 Remove IdentityMap 2012-03-13 20:08:54 -03:00
Aaron Patterson
5396fca1e2 give each PG type a type method and decortate tz attributes 2012-02-07 14:13:46 -08:00
Aaron Patterson
9bcb9cd55f column types are passed from the result set to the instantiated AR object 2012-02-07 13:51:52 -08:00
Jon Leighton
dae7b65453 Support establishing connection on ActiveRecord::Model.
This is the 'top level' connection, inherited by any models that include
ActiveRecord::Model or inherit from ActiveRecord::Base.
2011-12-28 18:27:41 +00:00
Jon Leighton
93c1f11c0a Support configuration on ActiveRecord::Model.
The problem: We need to be able to specify configuration in a way that
can be inherited to models that include ActiveRecord::Model. So it is
no longer sufficient to put 'top level' config on ActiveRecord::Base,
but we do want configuration specified on ActiveRecord::Base and
descendants to continue to work.

So we need something like class_attribute that can be defined on a
module but that is inherited when ActiveRecord::Model is included.

The solution: added ActiveModel::Configuration module which provides a
config_attribute macro. It's a bit specific hence I am not putting this
in Active Support or making it a 'public API' at present.
2011-12-28 18:27:41 +00:00
Jon Leighton
7293cac854 Extract common logic into a method 2011-12-24 11:08:15 +00:00
Jon Leighton
6af7192af5 I herd you like modules. 2011-12-24 11:08:15 +00:00
Jon Leighton
ceb33f8493 Split out most of the AR::Base code into separate modules 🍰 2011-12-15 20:45:37 +00:00