Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | User assert_kind_of, invert assert_equal expectations | Carlos Antonio da Silva | 2012-11-29 | 1 | -3/+3 |
| | |||||
* | Added STI support to init and building associations | Jason Rush | 2012-11-29 | 1 | -0/+28 |
| | | | | | | | | Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting. | ||||
* | Use method compilation for association methods | Jon Leighton | 2012-08-10 | 1 | -2/+2 |
| | | | | | | | | | Method compilation provides better performance and I think the code comes out cleaner as well. A knock on effect is that methods that get redefined produce warnings. I think this is a good thing. I had to deal with a bunch of warnings coming from our tests, though. | ||||
* | Deprecate ActiveRecord::Base.scoped. | Jon Leighton | 2012-07-27 | 1 | -7/+7 |
| | | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. | ||||
* | ActiveRecord::Base.all returns a Relation. | Jon Leighton | 2012-07-27 | 1 | -1/+1 |
| | | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway. | ||||
* | Deprecate update_column in favor of update_columns. | Rafael Mendonça França | 2012-07-24 | 1 | -2/+2 |
| | | | | Closes #1190 | ||||
* | fix assertion arguments order | Jon Leighton | 2012-07-13 | 1 | -2/+2 |
| | |||||
* | quarantine deprecated tests | Jon Leighton | 2012-05-18 | 1 | -1/+1 |
| | |||||
* | remove deprecated calls | Jon Leighton | 2012-04-27 | 1 | -3/+3 |
| | |||||
* | find and replace deprecated keys | Jon Leighton | 2012-04-27 | 1 | -2/+2 |
| | |||||
* | %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵ | Jon Leighton | 2012-04-27 | 1 | -4/+4 |
| | | | | things | ||||
* | remove calls to find(:first), find(:last) and find(:all) | Jon Leighton | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | Merge remote-tracking branch 'kennyj/fix_5563' | Jon Leighton | 2012-04-25 | 1 | -0/+11 |
|\ | | | | | | | | | Conflicts: activerecord/test/cases/associations/belongs_to_associations_test.rb | ||||
| * | Fix #5563. Should reflect the most recent change to either of association / id. | kennyj | 2012-04-13 | 1 | -0/+11 |
| | | |||||
* | | add missing test | Jon Leighton | 2012-04-25 | 1 | -0/+12 |
|/ | |||||
* | Get a properly aliased_table_name, when we use a polymorphic association. | kennyj | 2012-04-04 | 1 | -0/+1 |
| | |||||
* | Fix belongs_to polymorphic with custom primary key on target. | Jon Leighton | 2011-09-26 | 1 | -0/+8 |
| | | | | Closes #3104. | ||||
* | Don't find belongs_to target when the foreign_key is NULL. Fixes #2828 | Georg Friedrich | 2011-09-05 | 1 | -0/+6 |
| | |||||
* | Fix exception if old and new targets are both nil. Fixes #1471. | Jon Leighton | 2011-07-12 | 1 | -0/+9 |
| | |||||
* | Ensure that the foreign key gets set when doing record.create_association or ↵ | Jon Leighton | 2011-07-08 | 1 | -0/+14 |
| | | | | record.create_association. Fixes #1960. | ||||
* | added more tests for update_column | ganesh | 2011-06-04 | 1 | -0/+9 |
| | |||||
* | Handle polymorphic_type NOT NULL-able columns as well. | thedarkone | 2011-05-21 | 1 | -0/+11 |
| | |||||
* | Add block setting of attributes to singular associations | Andrew White | 2011-05-17 | 1 | -0/+21 |
| | |||||
* | 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> |