Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | we should not allow invalid objects to be constructed | Aaron Patterson | 2013-07-31 | 1 | -1/+2 | |
| | ||||||
* | push some validation up to the factory method | Aaron Patterson | 2013-07-31 | 1 | -4/+5 | |
| | ||||||
* | Refactor to use flat_map | Carlos Antonio da Silva | 2013-07-23 | 1 | -3/+3 | |
| | ||||||
* | extract mutation from generation method | Aaron Patterson | 2013-07-23 | 1 | -1/+1 | |
| | ||||||
* | AR::Base does not need to know how to create reflection objects | Aaron Patterson | 2013-07-22 | 1 | -1/+1 | |
| | ||||||
* | remove unnecessary reader | Aaron Patterson | 2013-07-22 | 1 | -4/+4 | |
| | ||||||
* | only flatten one side | Aaron Patterson | 2013-07-22 | 1 | -1/+1 | |
| | ||||||
* | extend by adding relationships rather than monkey patching | Aaron Patterson | 2013-07-22 | 1 | -5/+7 | |
| | ||||||
* | decouple extensions from association object state | Aaron Patterson | 2013-07-22 | 1 | -2/+2 | |
| | ||||||
* | #11288: Removed duplicated touching | Paul Nikitochkin | 2013-07-05 | 1 | -1/+1 | |
| | | | | | | if belongs to model with touch option on touch Closes #11288 | |||||
* | Dropped deprecated option `:restrict` for `:dependent` in associations | Neeraj Singh | 2013-07-03 | 3 | -9/+2 | |
| | ||||||
* | Removed support for deprecated `delete_sql` in associations. | Neeraj Singh | 2013-07-03 | 1 | -1/+1 | |
| | ||||||
* | Removed support for deprecated `insert_sql` in associations. | Neeraj Singh | 2013-07-02 | 1 | -1/+1 | |
| | ||||||
* | Removed support for deprecated `finder_sql` in associations. | Neeraj Singh | 2013-07-02 | 1 | -1/+1 | |
| | ||||||
* | Removed support for deprecated `counter_sql` | Neeraj Singh | 2013-07-02 | 1 | -1/+1 | |
| | ||||||
* | Removed deprecated options for assocations | Neeraj Singh | 2013-07-02 | 2 | -19/+0 | |
| | | | | | Deprecated options `delete_sql`, `insert_sql`, `finder_sql` and `counter_sql` have been deleted. | |||||
* | stop adding a new method for touch callbacks | Aaron Patterson | 2013-06-11 | 1 | -29/+21 | |
| | ||||||
* | push the touch method outside the eval | Aaron Patterson | 2013-06-11 | 1 | -13/+34 | |
| | ||||||
* | remove unused variable | Aaron Patterson | 2013-06-11 | 1 | -1/+0 | |
| | ||||||
* | check whether the association is constructible rather than checking constants | Aaron Patterson | 2013-06-11 | 1 | -3/+3 | |
| | ||||||
* | use attribute methods for finding key values rather than generating method names | Aaron Patterson | 2013-06-11 | 1 | -3/+3 | |
| | ||||||
* | push belongs_to counter cache method to a single method | Aaron Patterson | 2013-06-11 | 1 | -17/+18 | |
| | ||||||
* | push before_destroy counter cache method to a single method | Aaron Patterson | 2013-06-11 | 1 | -12/+17 | |
| | ||||||
* | remove evaled belongs_to counter cache method | Aaron Patterson | 2013-06-11 | 1 | -8/+22 | |
| | ||||||
* | adding callbacks should be private | Aaron Patterson | 2013-06-11 | 1 | -4/+6 | |
| | ||||||
* | remove evals from the association | Aaron Patterson | 2013-06-11 | 1 | -8/+2 | |
| | ||||||
* | reduce evals in depdendent associations | Aaron Patterson | 2013-06-11 | 1 | -1/+2 | |
| | ||||||
* | Getting rid of the +automatic_inverse_of: false+ option in associations in favor | wangjohn | 2013-06-08 | 2 | -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 Dev | 2013-05-19 | 1 | -11/+8 | |
| | ||||||
* | Added some more documentation for define_readers and define_writer of the ↵ | aditya-kapoor | 2013-05-15 | 3 | -0/+15 | |
| | | | | Association and its inherited classes | |||||
* | Added some more documentation for ↵ | aditya-kapoor | 2013-05-15 | 1 | -0/+11 | |
| | | | | ActiveRecord::Associations::Builder::Association class | |||||
* | Added documentation for ActiveRecord::Associations::Builder::Association class | aditya-kapoor | 2013-05-15 | 1 | -0/+4 | |
| | ||||||
* | Created a method to automatically find inverse associations and cache | wangjohn | 2013-05-07 | 2 | -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 decrementing | Ben Tucker | 2013-05-06 | 1 | -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 built | Andrew White | 2013-04-24 | 1 | -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 White | 2013-04-24 | 1 | -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 Hansson | 2013-04-23 | 1 | -12/+1 | |
| | | | | transitioning to new association" until a proper fix is found for #10197 | |||||
* | Update counter cache when pushing into association | Matthew Robertson | 2013-04-21 | 1 | -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 callback | Carlos Antonio da Silva | 2013-04-04 | 1 | -7/+7 | |
| | ||||||
* | Use the correct pk field from the reflected class to find the old record | Carlos Antonio da Silva | 2013-04-04 | 1 | -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 reflection | Andrew White | 2013-04-05 | 1 | -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-9091 | David Heinemeier Hansson | 2013-04-03 | 1 | -0/+10 | |
|\ | | | | | belongs_to :touch should touch old record when transitioning. | |||||
| * | Modifies belong_to touch callback to touch old associations also #9091 | Adam Gamble | 2013-03-14 | 1 | -0/+10 | |
| | | ||||||
* | | Update other counter caches on destroy | Ian Young | 2013-03-20 | 1 | -1/+1 | |
| | | ||||||
* | | If a counter_cache is defined, then using update_attributes and changing | John Wang | 2013-03-15 | 1 | -0/+20 | |
|/ | | | | | the primary key on an association will make sure that the corresponding counter on the association is changed properly. Fixes #9722. | |||||
* | Fix touching an invalid parent record for belongs_to | Olek Janiszewski | 2013-02-26 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | If the parent of a `belongs_to` record fails to be saved due to validation errors, `touch` will be called on a new record, which causes an exception (see https://github.com/rails/rails/pull/9320). Example: class Owner < ActiveRecord::Base validates_presence_of :name end class Pet < ActiveRecord::Base belongs_to :owner, touch: true end pet = Pet.new(owner: Owner.new) # Before, this line would raise ActiveRecord::ActiveRecordError # "can not touch on a new record object" pet.save | |||||
* | Undeprecate the :extend option | Jon Leighton | 2013-01-18 | 1 | -1/+2 | |
| | | | | | | | Suggested by @dhh. It doesn't affect the generated SQL, so seems reasonable to continue to allow it as an association option. | |||||
* | Ensure that associations have a symbol argument. | Steve Klabnik | 2012-11-28 | 1 | -0/+2 | |
| | | | | Fixes #7418. | |||||
* | Merge pull request #8116 from senny/7993_configure_counter_cache_for_has_many | Jon Leighton | 2012-11-09 | 1 | -1/+1 | |
|\ | | | | | :counter_cache option for to support custom named counter caches | |||||
| * | :counter_cache option for to support custom named counter caches. Closes #7993 | Yves Senn | 2012-11-04 | 1 | -1/+1 | |
| | |