aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/reflection_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* remove calls to find(:first), find(:last) and find(:all)Jon Leighton2012-04-261-1/+1
|
* reflection test fixedgregolsen2012-01-311-2/+2
|
* Deprecate inferred JOINs with includes + SQL snippets.Jon Leighton2012-01-161-2/+2
| | | | | | See the CHANGELOG for details. Fixes #950.
* serialize fails on subclassAlvaro Bautista2011-12-231-5/+5
|
* Fix test as one more has_many addedArun Agrawal2011-11-041-1/+1
|
* Allow the :class_name option for associations to take a symbol.Jon Leighton2011-11-041-1/+5
| | | | | This is to avoid confusing newbies, and to be consistent with the fact that other options like :foreign_key already allow a symbol or a string.
* Fix #3271.Jon Leighton2011-11-031-0/+6
| | | | | | | | Building the conditions of a nested through association could potentially modify the conditions of the through and/or source association. This is a Bad Thing.
* Raise an exception on unknown primary key inside AssociationReflection.Jon Leighton2011-10-051-0/+15
| | | | | An association between two models cannot be made if a relevant key is unknown, so fail fast rather than generating invalid SQL. Fixes #3207.
* Don't call self.class unless necessary. Closes #3171.Jon Leighton2011-09-291-0/+1
|
* Fix belongs_to polymorphic with custom primary key on target.Jon Leighton2011-09-261-1/+0
| | | | Closes #3104.
* cache the plural name on the reflection so we do not pay pluralize costs on ↵Aaron Patterson2011-06-301-1/+1
| | | | joins
* 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.
* removed deprecated methods, and related tests, from ActiveRecordJosh Kalderimis2011-05-251-7/+0
|
* Fix problem with loading polymorphic associations which have been defined in ↵Jon Leighton2011-05-221-2/+2
| | | | an abstract superclass. Fixes #552.
* oracle, y u defy meJon Leighton2011-03-161-5/+5
|
* Simplify implementation of ThroughReflection#chainJon Leighton2011-03-111-1/+1
|
* Rename Reflection#through_reflection_chain and #through_options to ↵Jon Leighton2011-03-101-5/+5
| | | | Reflection#chain and Reflection#options as they now no longer relate solely to through associations.
* Push source_type and polymorphic conditions out of ThroughAssociation and ↵Jon Leighton2011-03-051-2/+2
| | | | JoinDependency::JoinAssociation and into the reflection instead.
* Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-041-5/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
| * Construct an actual ActiveRecord::Relation object for the association scope, ↵Jon Leighton2011-01-071-2/+2
| | | | | | | | rather than a hash which is passed to apply_finder_options. This allows more flexibility in how the scope is created, for example because scope.where(a, b) and scope.where(a).where(b) mean different things.
| * Implement deprecated version of AssociationReflection#primary_key_name, ↵Jon Leighton2011-01-031-0/+12
| | | | | | | | which has been renamed to #foreign_key. Also bumping the deprecation_horizon in Active Support to 3.1.
| * Have a proper AssociationReflection#foreign_type method rather than using ↵Jon Leighton2011-01-031-0/+6
| | | | | | | | options[:foreign_type]
| * Rename AssociationReflection#primary_key_name to foreign_key, since the ↵Jon Leighton2010-12-311-3/+5
| | | | | | | | options key which it relates to is :foreign_key
| * Improved strategy for updating a belongs_to association when the foreign key ↵Jon Leighton2010-12-231-0/+2
| | | | | | | | changes. Rather than resetting each affected association when the foreign key changes, we should lazily check for 'staleness' (where fk does not match target id) when the association is accessed.
| * Fix problem where wrong keys are used in JoinAssociation when an association ↵Jon Leighton2010-12-201-0/+5
| | | | | | | | goes :through a belongs_to [#2801 state:resolved]
| * Fix various issues with the :primary_key option in :through associations ↵Jon Leighton2010-12-151-0/+5
| | | | | | | | [#2421 state:resolved]
* | Merge branch 'master' into nested_has_many_throughJon Leighton2010-12-121-1/+1
|\| | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb
| * Doesn't need to sort, lets users of attribute_names sort them if they wantSantiago Pastorino2010-12-021-1/+1
| |
* | Merge branch 'master' into nested_has_many_throughJon Leighton2010-11-081-5/+5
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * Add timestamps to TopicPratik Naik2010-11-021-5/+5
| |
* | Fix naughty trailing whitespaceJon Leighton2010-10-311-9/+9
| |
* | Add explicit tests for the nested through association changes in reflection.rbJon Leighton2010-10-191-0/+64
|/
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* adding column named 'group' to ensure that nothing breaks given that 'group' ↵Neeraj Singh2010-06-231-5/+5
| | | | | | | | is sql reserved word [#4945 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* removing dead code from activerecord tests. [#4187 state:resolved]Aaron Patterson2010-03-151-6/+0
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Renamed AssociationReflection #collection_association? to #collection?.Eloy Duran2010-01-081-4/+4
|
* Moved the validation logic to the association reflection and refactored ↵Eloy Duran2010-01-071-8/+39
| | | | autosave_association.rb a bit.
* Add AssociationReflection#collection_association? which returns true if it's ↵Eloy Duran2010-01-071-0/+9
| | | | for a has_many or has_and_belongs_to_many association.
* Changed ActiveRecord::Base.store_full_sti_class to be true by default ↵David Heinemeier Hansson2010-01-031-0/+4
| | | | reflecting the previously announced Rails 3 default [DHH]
* delete correct records for a has_many with :primary_key and :dependent => ↵Matt Jones2009-11-101-2/+2
| | | | | | :delete_all Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Move validator, human_name and human_attribute_name to ActiveModel, remove ↵José Valim2009-10-201-2/+2
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Make has_one with :conditions hash scope build or creation of the associated ↵Luciano G Panaro2009-09-281-2/+2
| | | | | | | object with those conditions Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3088 state:committed]
* Fix has_one with foreign_key and primary_key association bug which caused ↵Graeme Porteous2009-09-121-2/+2
| | | | | | | | the associated object being lost when saving the owner. [#1756 state:resolved] Mixed in a bit from patch by ransom-briggs. [#2813 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Explicitely setting `autosave => false' should override new_record ↵Eloy Duran2009-09-121-3/+3
| | | | | | autosaving. [#2214 state:resolved] Original author is Jacob.
* has_many :through create should not raise validation errorsrailsbob2009-08-091-2/+2
| | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add primary_key option to belongs_to associationSzymon Nowak2009-07-151-5/+5
| | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-011-2/+2
| | | | | | | | | a newline character immediately following 'SELECT' [#2118 state:resolved]"" This reverts commit 80f1f863cd0f9cba89079511282de5710a2e1832. The feature doesn't work on Postgres, so don't test it on Postgres. Also, Postgres compatibility is irrelevant to the ticket/patch in question.
* Changed ActiveRecord::Base.human_name to underscore the class name before it ↵Justin French2009-06-301-1/+7
| | | | | | | | | humanizes it This gives you 'Post comment' rather than 'Postcomment' by default. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2120 state:committed]
* Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-221-2/+2
| | | | | | | | newline character immediately following 'SELECT' [#2118 state:resolved]" This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a. The tests do not pass for postgresql.