aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/association_scope.rb
Commit message (Collapse)AuthorAgeFilesLines
* use | to have more intent revealing codeNeeraj Singh2013-04-041-1/+1
| | | | thanks to @egilburg for suggestion
* has_many through obeys order on through associationNeeraj Singh2013-04-041-0/+1
| | | | fixes #10016
* hide more data in the schema cacheAaron Patterson2013-03-141-1/+1
|
* Prevent Relation#merge from collapsing wheres on the RHSJon Leighton2013-01-271-4/+8
| | | | | | | | | | | | | | | | | | | | | | | This caused a bug with the new associations implementation, because now association conditions are represented as Arel nodes internally right up to when the whole thing gets turned to SQL. In Rails 3.2, association conditions get turned to raw SQL early on, which prevents Relation#merge from interfering. The current implementation was buggy when a default_scope existed on the target model, since we would basically end up doing: default_scope.merge(association_scope) If default_scope contained a where(foo: 'a') and association_scope contained a where(foo: 'b').where(foo: 'c') then the merger would see that the same column is representated on both sides of the merge and collapse the wheres to all but the last: where(foo: 'c') Now, the RHS of the merge is left alone. Fixes #8990
* Undeprecate the :extend optionJon Leighton2013-01-181-0/+1
| | | | | | | Suggested by @dhh. It doesn't affect the generated SQL, so seems reasonable to continue to allow it as an association option.
* Revert "Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql."Jon Leighton2012-08-011-1/+1
| | | | | | | | | This reverts commit 3803fcce26b837c0117f7d278b83c366dc4ed370. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1.
* Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql.Jon Leighton2012-07-201-1/+1
|
* fix association :extend optionJon Leighton2012-07-131-6/+2
|
* Represent association scope options as AR::Relations insternally.Jon Leighton2012-07-131-40/+15
|
* predicate builder should not recurse for determining where columns.Aaron Patterson2012-05-301-2/+17
| | | | | | Thanks to Ben Murphy for reporting this CVE-2012-2661
* remove apply_finder_options call from AssociationScopeJon Leighton2012-04-131-7/+8
|
* Revert "only mutate the scope object in the `bind` method"Aaron Patterson2012-02-271-1/+1
| | | | This reverts commit 1b9e19cd22f2b5d5e7b82e042f92340822c0f966.
* only mutate the scope object in the `bind` methodAaron Patterson2012-02-271-1/+1
|
* bind value creation refactoringAaron Patterson2012-02-271-4/+10
|
* removing dead codeAaron Patterson2012-02-271-3/+2
|
* use bind values for join columnsAaron Patterson2012-02-271-1/+16
|
* fix associations when using per class databasesLars Kanis2012-02-101-1/+1
| | | | | | would get ConnectionNotEstablished error because it always tried to use ActiveRecord::Base's connection, even though it should be using the connection of the model whose context we're operating in
* Deprecate inferred JOINs with includes + SQL snippets.Jon Leighton2012-01-161-1/+1
| | | | | | See the CHANGELOG for details. Fixes #950.
* Avoid sanitize_sql when we can use Relation#where insteadJon Leighton2012-01-161-2/+5
|
* Revert "Deprecate implicit eager loading. Closes #950."Jon Leighton2012-01-161-1/+1
| | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9.
* Remove Array.wrap calls in ActiveRecordRafael Mendonça França2012-01-061-1/+1
|
* Deprecate implicit eager loading. Closes #950.Jon Leighton2011-12-291-1/+1
|
* Use uniq instead of manually putting a DISTINCT in the queryJon Leighton2011-11-051-14/+2
|
* Merge pull request #3030 from htanata/fix_habtm_select_query_methodJon Leighton2011-09-261-4/+0
| | | | Fix: habtm doesn't respect select query method
* Fix belongs_to polymorphic with custom primary key on target.Jon Leighton2011-09-261-1/+6
| | | | Closes #3104.
* use association_primary_key in AssociationScope#add_constraintsMarian Rudzynski2011-05-261-1/+1
|
* Fix problem with loading polymorphic associations which have been defined in ↵Jon Leighton2011-05-221-5/+15
| | | | an abstract superclass. Fixes #552.
* Fix tests under postgres - we should always put conditions in the WHERE part ↵Jon Leighton2011-03-121-5/+8
| | | | not in ON constraints because postgres requires that the table has been joined before the condition references it.
* Abstract some common code from AssociationScope and ↵Jon Leighton2011-03-111-44/+12
| | | | JoinDependency::JoinAssociation into a JoinHelper module
* Rename Reflection#through_reflection_chain and #through_options to ↵Jon Leighton2011-03-101-6/+6
| | | | Reflection#chain and Reflection#options as they now no longer relate solely to through associations.
* Move the code which builds a scope for through associations into a generic ↵Jon Leighton2011-03-101-0/+149
AssociationScope class which is capable of building a scope for any association.