aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/builder
Commit message (Collapse)AuthorAgeFilesLines
...
* remove dependency on @model when defining callbacksAaron Patterson2013-08-012-8/+8
|
* extract more mutations to the callerAaron Patterson2013-08-012-13/+16
|
* separate some mutations from reflection constructionAaron Patterson2013-08-012-6/+6
|
* oops! :bomb:Aaron Patterson2013-07-311-1/+1
|
* do is_a? tests on assignment so runtime is fasterAaron Patterson2013-07-311-1/+11
|
* no need to to_symAaron Patterson2013-07-311-1/+1
|
* pass the mixin in to the code generation methodsAaron Patterson2013-07-313-11/+11
|
* we should not allow invalid objects to be constructedAaron Patterson2013-07-311-1/+2
|
* push some validation up to the factory methodAaron Patterson2013-07-311-4/+5
|
* Refactor to use flat_mapCarlos Antonio da Silva2013-07-231-3/+3
|
* extract mutation from generation methodAaron Patterson2013-07-231-1/+1
|
* AR::Base does not need to know how to create reflection objectsAaron Patterson2013-07-221-1/+1
|
* remove unnecessary readerAaron Patterson2013-07-221-4/+4
|
* only flatten one sideAaron Patterson2013-07-221-1/+1
|
* extend by adding relationships rather than monkey patchingAaron Patterson2013-07-221-5/+7
|
* decouple extensions from association object stateAaron Patterson2013-07-221-2/+2
|
* #11288: Removed duplicated touchingPaul Nikitochkin2013-07-051-1/+1
| | | | | | if belongs to model with touch option on touch Closes #11288
* Dropped deprecated option `:restrict` for `:dependent` in associationsNeeraj Singh2013-07-033-9/+2
|
* Removed support for deprecated `delete_sql` in associations.Neeraj Singh2013-07-031-1/+1
|
* Removed support for deprecated `insert_sql` in associations.Neeraj Singh2013-07-021-1/+1
|
* Removed support for deprecated `finder_sql` in associations.Neeraj Singh2013-07-021-1/+1
|
* Removed support for deprecated `counter_sql`Neeraj Singh2013-07-021-1/+1
|
* Removed deprecated options for assocationsNeeraj Singh2013-07-022-19/+0
| | | | | Deprecated options `delete_sql`, `insert_sql`, `finder_sql` and `counter_sql` have been deleted.
* stop adding a new method for touch callbacksAaron Patterson2013-06-111-29/+21
|
* push the touch method outside the evalAaron Patterson2013-06-111-13/+34
|
* remove unused variableAaron Patterson2013-06-111-1/+0
|
* check whether the association is constructible rather than checking constantsAaron Patterson2013-06-111-3/+3
|
* use attribute methods for finding key values rather than generating method namesAaron Patterson2013-06-111-3/+3
|
* push belongs_to counter cache method to a single methodAaron Patterson2013-06-111-17/+18
|
* push before_destroy counter cache method to a single methodAaron Patterson2013-06-111-12/+17
|
* remove evaled belongs_to counter cache methodAaron Patterson2013-06-111-8/+22
|
* adding callbacks should be privateAaron Patterson2013-06-111-4/+6
|
* remove evals from the associationAaron Patterson2013-06-111-8/+2
|
* reduce evals in depdendent associationsAaron Patterson2013-06-111-1/+2
|
* Getting rid of the +automatic_inverse_of: false+ option in associations in favorwangjohn2013-06-082-2/+2
| | | | | of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature.
* copy edits[ci skip]Vijay Dev2013-05-191-11/+8
|
* Added some more documentation for define_readers and define_writer of the ↵aditya-kapoor2013-05-153-0/+15
| | | | Association and its inherited classes
* Added some more documentation for ↵aditya-kapoor2013-05-151-0/+11
| | | | ActiveRecord::Associations::Builder::Association class
* Added documentation for ActiveRecord::Associations::Builder::Association classaditya-kapoor2013-05-151-0/+4
|
* Created a method to automatically find inverse associations and cachewangjohn2013-05-072-2/+2
| | | | | | the results. Added tests to check to make sure that inverse associations are automatically found when has_many, has_one, or belongs_to associations are defined.
* Confirm a record has not already been destroyed before decrementingBen Tucker2013-05-061-1/+3
| | | | | | | | | counter cache At present, calling destroy multiple times on the same record results in the belongs_to counter cache being decremented multiple times. With this change the record is checked for whether it is already destroyed prior to decrementing the counter cache.
* Lookup the class at runtime, not when the association is builtAndrew White2013-04-241-2/+2
| | | | | | | | | Trying to lookup the parent class when the association is being built runs the risk of generating uninitialized constant errors because classes haven't been fully defined yet. To work around this we look up the class at runtime through the `association` method. Fixes #10197.
* Revert "Revert "`belongs_to :touch` behavior now touches old association ↵Andrew White2013-04-241-1/+12
| | | | | | | | | when transitioning to new association" until a proper fix is found for #10197" This reverts commit 7389df139a35436f00876c96d20e81ba23c93f0a. Conflicts: activerecord/test/cases/timestamp_test.rb
* Revert "`belongs_to :touch` behavior now touches old association when ↵David Heinemeier Hansson2013-04-231-12/+1
| | | | transitioning to new association" until a proper fix is found for #10197
* Update counter cache when pushing into associationMatthew Robertson2013-04-211-3/+4
| | | | | | | | | | | | | | | | This commit fixes a regression bug in which counter_cache columns were not being updated correctly when newly created records were being pushed into an assocation. EG: # this was fine @post.comment.create! # this was fine @comment = Comment.first @post.comments << @comment # this would not update counters @post.comments << Comment.create!
* Avoid an attempt to fetch old record when id was not present in touch callbackCarlos Antonio da Silva2013-04-041-7/+7
|
* Use the correct pk field from the reflected class to find the old recordCarlos Antonio da Silva2013-04-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The implementation was using the source class foreign key field instead of the reflected primary key one to find the old record. For instance, for this scenario class Bulb < ActiveRecord::Base belongs_to :car, :touch => true end class Car < ActiveRecord::Base has_many :bulbs end the current implementation was trying to do this query: Car.where(car_id: X).first where we should be doing this query: Car.where(id: X).first This should hopefully fix the build.
* Use inspect when writing the foreign key from the reflectionAndrew White2013-04-051-2/+2
| | | | | | If we don't use inspect inside the class_eval block then the foreign key is written without quotes causing us to fetch the foreign key value and not the column name.
* Merge pull request #9141 from adamgamble/issue-9091David Heinemeier Hansson2013-04-031-0/+10
|\ | | | | belongs_to :touch should touch old record when transitioning.
| * Modifies belong_to touch callback to touch old associations also #9091Adam Gamble2013-03-141-0/+10
| |