aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/model_schema.rb
Commit message (Collapse)AuthorAgeFilesLines
* Minor refactoring in Active Record model schema methodsCarlos Antonio da Silva2012-08-211-5/+3
| | | | | | * Use each_key instead of generating intermediate keys array. * Use each_with_object instead of inject to build hash. * Use ternary to return instead of if + assignment.
* The default value can be set once in #column_defaultsJon Leighton2012-08-171-0/+7
| | | | Rather than doing it every time an instance is instantiated.
* load active_support/concern in active_support/railsXavier Noria2012-08-021-1/+0
|
* Refactor to reset_table_nameDmitry Vorotilin2012-07-281-8/+4
|
* Simplify AR configuration code.Jon Leighton2012-06-151-9/+14
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Fix wrong return value from reset_sequence_name method.kennyj2012-04-141-1/+1
|
* Don't reset inheritance_column when setting explicitly.kennyj2012-03-081-1/+2
|
* Revert table_name= needs connection now, so just stub table_namekennyj2012-03-071-1/+1
|
* tidy up formattingJon Leighton2012-03-041-10/+11
|
* Don't clear sequence name when we explicitly assign it.kennyj2012-03-041-2/+4
|
* Fix GH #4674. Reset column information and sequence name when setting ↵kennyj2012-03-041-4/+11
| | | | table_name.
* Remove unusused variablesJon Leighton2012-03-041-9/+6
|
* give each PG type a `type` method and decortate tz attributesAaron Patterson2012-02-071-5/+17
|
* wrap and cache columns for typecastingAaron Patterson2012-02-071-3/+18
|
* call to_s on value passed to table_name=Sergey Nartimov2012-01-261-1/+1
|
* Fix table_name in ActiveRecord with more than one abstract ancestorsPiotr Sarnacki2012-01-121-3/+7
| | | | | | | | | | | | | | | | | When subclassing abstract_class table_name should be always computed based on class name, no matter if superclass is subclassing base or another abstract_class. So: class FirstAbstract < ActiveRecord::Base self.abstract_class = true end class SecondAbstract < FirstAbstract self.abstract_class = true end class Post < SecondAbstract self.table_name #=> 'posts' (not 'second_abstracts') end
* Support establishing connection on ActiveRecord::Model.Jon Leighton2011-12-281-5/+1
| | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-12/+12
| | | | | | | | | | | | | | | 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.
* Support nested AR::ModelsJon Leighton2011-12-241-1/+1
|
* Deal with global config better between AR::Base and AR::ModelJon Leighton2011-12-241-10/+10
|
* Extract common logic into a methodJon Leighton2011-12-241-5/+5
|
* I herd you like modules.Jon Leighton2011-12-241-2/+2
|
* remove deprecated set and original methods for table_name, primary_key, etcSergey Nartimov2011-12-211-55/+0
|
* Defaults hash can go on the modelJon Leighton2011-12-161-1/+1
|
* Cache columns at the model level.Jon Leighton2011-12-161-6/+7
| | | | Allows two models to use the same table but have different primary keys.
* Split out most of the AR::Base code into separate modules :cake:Jon Leighton2011-12-151-0/+361