Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | assert_difference can take a callable piece of code rather than just evaling ↵ | Aaron Patterson | 2011-05-01 | 1 | -4/+4 | |
| | | | | a string | |||||
* | fixing more test warnings in 1.9.3 | Aaron Patterson | 2011-04-30 | 1 | -3/+3 | |
| | ||||||
* | Split AssociationProxy into an Association class (and subclasses) which ↵ | Jon Leighton | 2011-02-18 | 1 | -8/+5 | |
| | | | | manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more. | |||||
* | belongs_to records should be initialized within the association scope | Jon Leighton | 2011-01-16 | 1 | -0/+21 | |
| | ||||||
* | Add create_association! for belongs_to | Jon Leighton | 2011-01-16 | 1 | -0/+17 | |
| | ||||||
* | Fix polymorphic belongs_to associationproxy raising errors when loading target. | Ernie Miller | 2011-01-11 | 1 | -0/+9 | |
| | ||||||
* | just use a hash for doing association caching | Aaron Patterson | 2011-01-07 | 1 | -2/+2 | |
| | ||||||
* | fixing merge errors | Aaron Patterson | 2011-01-04 | 1 | -11/+0 | |
| | ||||||
* | Allow assignment on has_one :through where the owner is a new record [#5137 ↵ | Jon Leighton | 2011-01-03 | 1 | -19/+14 | |
| | | | | | | | | | | state:resolved] This required changing the code to keep the association proxy for a belongs_to around, despite its target being nil. Which in turn required various changes to the way that stale target checking is handled, in order to support various edge cases (loaded target is nil then foreign key added, foreign key is changed and then changed back, etc). A side effect is that the code is nicer and more succinct. Note that I am removing test_no_unexpected_aliasing since that is basically checking that the proxy for a belongs_to *does* change, which is the exact opposite of the intention of this commit. Also adding various tests for various edge cases and related things. Phew, long commit message! | |||||
* | Some basic tests for the :foreign_type option on belongs_to, which was ↵ | Jon Leighton | 2011-01-03 | 1 | -0/+19 | |
| | | | | previously completely untested. | |||||
* | Support for :counter_cache on polymorphic belongs_to | Jon Leighton | 2010-12-31 | 1 | -0/+12 | |
| | ||||||
* | Refactor BelongsToAssociation to allow BelongsToPolymorphicAssociation to ↵ | Jon Leighton | 2010-12-31 | 1 | -6/+36 | |
| | | | | inherit from it | |||||
* | If a has_many goes :through a belongs_to, and the foreign key of the ↵ | Jon Leighton | 2010-12-23 | 1 | -23/+37 | |
| | | | | belongs_to changes, then the has_many should be considered stale. | |||||
* | Setting the id of a belongs_to object updates all referenced objects [#2989 ↵ | Jeff Dean | 2010-12-08 | 1 | -0/+37 | |
| | | | | state:resolved] | |||||
* | use persisted? instead of new_record? wherever possible | David Chelimsky | 2010-11-09 | 1 | -6/+6 | |
| | | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | |||||
* | Convert :primary_key in association to a string before comparing to column ↵ | Denis Odorcic | 2010-10-30 | 1 | -0/+7 | |
| | | | | names, so that for example :primary_key => :another_pk works as well [#5605 state:resolved] | |||||
* | Set attributes properly for model built from association with conditions ↵ | Marcelo Giorgi | 2010-09-28 | 1 | -0/+5 | |
| | | | | | | [#5562 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | |||||
* | removing unused code | Aaron Patterson | 2010-08-22 | 1 | -2/+2 | |
| | ||||||
* | code gardening: we have assert_(nil|blank|present), more concise, with ↵ | Xavier Noria | 2010-08-17 | 1 | -1/+1 | |
| | | | | better default failure messages - let's use them | |||||
* | update tests for mysql2 support | Brian Lopez | 2010-08-02 | 1 | -1/+1 | |
| | ||||||
* | Don't increment and then decrement the same counter when re-assigning a ↵ | Tarmo Tänav | 2010-07-29 | 1 | -0/+4 | |
| | | | | | | | | belongs_to association [#2786 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | |||||
* | removing unused models from tests | Subba Rao Pasupuleti | 2010-07-21 | 1 | -2/+0 | |
| | | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | fix test_belongs_to_with_primary_key_joins_on_correct_column test on Oracle | Raimonds Simanovskis | 2010-06-04 | 1 | -0/+4 | |
| | ||||||
* | Use better assertion methods for testing | Neeraj Singh | 2010-05-19 | 1 | -2/+2 | |
| | | | | | | [#4645 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | kill warnings on 1.8.7 [#4331 state:resolved] | Aaron Patterson | 2010-04-10 | 1 | -4/+4 | |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Fix failing test in MySQL. | Emilio Tagua | 2010-03-30 | 1 | -3/+8 | |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Fix honoring :primary_key option when joining or eager loading a belongs_to ↵ | Ernie Miller | 2010-03-29 | 1 | -0/+13 | |
| | | | | | | | | association [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | |||||
* | Add :dependent = to has_one and has_many [#3075 state:resolved] | Rizwan Reza | 2010-03-28 | 1 | -1/+7 | |
| | ||||||
* | Fix associations to call :destroy or :delete based on the right :dependent ↵ | Carlos Antonio da Silva | 2010-03-09 | 1 | -6/+26 | |
| | | | | | | option Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Removed duplicated tests [#3026 state:resolved] | Arthur Zapparoli | 2009-08-10 | 1 | -18/+0 | |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | added :order option to find :first methods and associations as otherwise ↵ | Raimonds Simanovskis | 2009-08-06 | 1 | -2/+4 | |
| | | | | | | | | Oracle tests were failing Oracle stores '' string as NULL Oracle cannot have identifiers larger than 30 characters added missing fixtures to test setup method | |||||
* | Add primary_key option to belongs_to association | Szymon Nowak | 2009-07-15 | 1 | -0/+98 | |
| | | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | |||||
* | Fixed autosave checks on objects with hm:t in :include [#2213 state:resolved] | Will Bryant | 2009-03-12 | 1 | -0/+16 | |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. | Jeremy Kemper | 2009-03-08 | 1 | -2/+2 | |
| | | | | [#1617 state:resolved] | |||||
* | Ensure belongs_to association with a counter cache in name spaced model ↵ | Adam Cooper | 2009-03-06 | 1 | -0/+17 | |
| | | | | | | works [#1678 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | Fixed that autosave should validate associations even if master is invalid ↵ | David Heinemeier Hansson | 2009-02-27 | 1 | -129/+0 | |
| | | | | [#1930 status:committed] | |||||
* | Ensure methods called on association proxies respect access control. [#1083 ↵ | Pratik Naik | 2008-10-13 | 1 | -0/+10 | |
| | | | | state:resolved] [Adam Milligan, Pratik] | |||||
* | Remove the functionality introduce in 28d3390 | Michael Koziarski | 2008-10-10 | 1 | -13/+0 | |
| | | | | There are several situations it doesn't cater for, and the inconsistency isn't worth blocking 2.2. | |||||
* | Support for updating a belongs to association from the foreign key (without ↵ | Jon Leighton | 2008-09-13 | 1 | -0/+13 | |
| | | | | | | | saving and reloading the record) Signed-off-by: Michael Koziarski <michael@koziarski.com> [#142 state:committed] | |||||
* | Fix file permissions | Tarmo Tänav | 2008-07-31 | 1 | -0/+0 | |
| | | | | Signed-off-by: Joshua Peek <josh@joshpeek.com> | |||||
* | Add :validate option to associations. [#301 state:resolved] | Jan De Poorter | 2008-06-11 | 1 | -0/+19 | |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | belongs_to polymorphic association assignments update the foreign_id and ↵ | Tim Harper | 2008-05-31 | 1 | -1/+28 | |
| | | | | | | | | | | | foreign_type fields regardless of whether the record being assigned is new or not. fixes the following scenarios: * I have validates_inclusion_of on the type field for a polymorphic belongs_to association. I assign a new record to the model's polymorphic relationship of the proper type. validation fails because the type field has not been updated. * I replace the value for a ppolymorphic association to a new record of another class. The type field still says its the previous class, and the id field points to the previous record as well. [#191 state:closed] | |||||
* | Added :select option to has_one and belongs_to, remove unused :order option ↵ | josevalim | 2008-05-24 | 1 | -0/+5 | |
| | | | | | | | on belongs_to. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#241 state:resolved] | |||||
* | Don't rely on association proxying object_id. [#225 state:resolved] | Jeremy Kemper | 2008-05-19 | 1 | -2/+2 | |
| | ||||||
* | Revert "Ensure that save on child object fails for invalid belongs_to ↵ | Michael Koziarski | 2008-04-11 | 1 | -12/+0 | |
| | | | | | | association. Closes #11555. [rubyruy]" This reverts commit c67e985994362290308073ed2793dd8e7f2a76db. | |||||
* | Ensure that save on child object fails for invalid belongs_to association. ↵ | Pratik Naik | 2008-04-10 | 1 | -0/+12 | |
| | | | | | | Closes #11555. [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9247 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | |||||
* | Split associations_test.rb into multiple files based on association type. ↵ | Pratik Naik | 2008-04-06 | 1 | -0/+380 | |
[Pratik] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |