aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods
Commit message (Collapse)AuthorAgeFilesLines
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-1/+0
| | | | | | | | | | | | | | | 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.
* Deal with global config better between AR::Base and AR::ModelJon Leighton2011-12-241-0/+1
|
* Extract common logic into a methodJon Leighton2011-12-241-0/+1
|
* Fix #4046.Jon Leighton2011-12-231-0/+1
|
* Let AttributeMethods do its own including etcJon Leighton2011-12-151-4/+2
|
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-051-4/+0
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-051-0/+4
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* Always generate attribute methods on the base class.Jon Leighton2011-09-131-0/+1
| | | | | | | | | | | | | | This fixes a situation I encountered where a subclass would cache the name of a generated attribute method in @_defined_class_methods. Then, when the superclass has it's attribute methods undefined, the subclass would always have to dispatch through method_missing, because the presence of the attribute in @_defined_class_methods would mean that it is never generated again, even if undefine_attribute_methods is called on the subclass. There various other confusing edge cases like this. STI classes share columns, so let's just keep all the attribute method generation state isolated to the base class.
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-2/+3
| | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
* oops, no need for puts!Aaron Patterson2011-02-181-1/+0
|
* AR::AttributeMethods does not need to be included in an AR::Base class.Aaron Patterson2011-02-181-0/+62