aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4543 from jdelStrother/find_or_initJon Leighton2012-02-011-2/+1
|\ | | | | Don't instantiate two objects in collection proxy / find_or_instantiate_by
| * Don't instantiate two objects in collection proxy / find_or_instantiator_byJonathan del Strother2012-01-191-2/+1
| |
* | Use human attribute name to show the dependent destroy messageRafael Mendonça França2012-02-011-1/+2
| |
* | fix has_one, has_many restrict error messageManoj2012-02-011-1/+2
| |
* | Merge pull request #4799 from arunagw/warning_fixed_for_indentationsAaron Patterson2012-01-311-1/+1
|\ \ | | | | | | warning removed: mismatched indentations
| * | warning removed: mismatched indentationsArun Agrawal2012-01-311-1/+1
| | |
* | | Put spaces between the words at deprecation warningRafael Mendonça França2012-01-311-3/+3
|/ /
* | Merge pull request #4783 from gregolsen/ids_reader_fixJon Leighton2012-01-311-1/+1
|\ \ | | | | | | ids_reader method fixed, test added to has_many association (for PostgreSQL)
| * | ids_reader method fixed, test added to has_many associationgregolsen2012-01-311-1/+1
| |/
* | suggested fixes for :dependent => :restrict deprecation.Manoj2012-01-311-1/+1
| |
* | Same method for has_many and has_one associationsPaco Guzman2012-01-313-30/+17
| |
* | Easy dependent_restrict error messagePaco Guzman2012-01-312-4/+2
| |
* | has_many/has_one, :dependent => :restrict, deprecation added.Manoj2012-01-293-3/+35
|/
* Deprecate inferred JOINs with includes + SQL snippets.Jon Leighton2012-01-162-2/+2
| | | | | | See the CHANGELOG for details. Fixes #950.
* Avoid sanitize_sql when we can use Relation#where insteadJon Leighton2012-01-164-22/+16
|
* Revert "Deprecate implicit eager loading. Closes #950."Jon Leighton2012-01-164-4/+2
| | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9.
* Remove Array.wrap calls in ActiveRecordRafael Mendonça França2012-01-064-7/+5
|
* Use 1.9 waySantiago Pastorino2012-01-051-6/+1
|
* Removed metaclass from the has_many dependency destroy method. Fixes #2954Dmitry Polushkin2011-12-312-8/+5
|
* Deprecate implicit eager loading. Closes #950.Jon Leighton2011-12-294-2/+4
|
* added failing tests for has_many, has_one and belongs_to associations with ↵Jakub Kuźma2011-12-211-6/+1
| | | | strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
* bypass preloading for ids_readerSergey Nartimov2011-12-181-2/+10
| | | | | when fetching ids for a collection, bypass preloading to avoid the unnecessary performance overhead
* Allow nested attributes in associations to update values in it's owner ↵Andrew Kaspick2011-12-141-0/+2
| | | | object. Fixes a regression from 3.0.x
* Fix #3672 again (dependent: delete_all perf)Jon Leighton2011-12-146-9/+26
|
* Fix #3890. (Calling proxy_association in scope chain.)Jon Leighton2011-12-081-2/+8
|
* reintroduce patch from #726 to handle nested eager loading via associationsJay Levitt2011-11-301-1/+1
|
* ActiveRecord::Relation#pluck methodBogdan Gusiev2011-11-301-1/+1
|
* Merge pull request #3636 from joshsusser/masterJon Leighton2011-11-296-21/+22
|\ | | | | association methods are now generated in modules
| * avoid warningsJosh Susser2011-11-276-15/+15
| | | | | | | | | | | | | | This change uses Module.redefine_method as defined in ActiveSupport. Making Module.define_method public would be as clean in the code, and would also emit warnings when redefining an association. That is pretty messy given current tests, so I'm leaving it for someone else to decide what approach is better.
| * use GeneratedFeatureMethods module for associationsJosh Susser2011-11-272-7/+13
| |
| * association methods are now generated in modulesJosh Susser2011-11-157-30/+25
| | | | | | | | | | | | | | | | | | | | Instead of generating association methods directly in the model class, they are generated in an anonymous module which is then included in the model class. There is one such module for each association. The only subtlety is that the generated_attributes_methods module (from ActiveModel) must be forced to be included before association methods are created so that attribute methods will not shadow association methods.
* | load has_many associations keyed off a custom primary key if that key is ↵Brian Samson2011-11-252-1/+5
| | | | | | | | present but the record is unsaved
* | Perf fixJon Leighton2011-11-191-2/+6
|/ | | | | | | If we're deleting all records in an association, don't add a IN(..) clause to the query. Fixes #3672.
* Use uniq instead of manually putting a DISTINCT in the queryJon Leighton2011-11-051-14/+2
|
* Merge pull request #3507 from jmazzi/issue-3503Jeremy Kemper2011-11-031-2/+6
| | | | Preserve SELECT columns on the COUNT for finder_sql when possible
* Memoize through associationJon Leighton2011-11-031-8/+11
|
* Remove all revelant through records.Jon Leighton2011-11-031-9/+9
| | | | | | | | | If a record is removed from a has_many :through, all of the join records relating to that record should also be removed from the through association's target. (Previously the records were removed in the database, but only one was removed from the in-memory target array.)
* Fix adding multiple instances of the same record to a has_many :through.Jon Leighton2011-11-031-21/+43
| | | | Fixes #3425.
* Fix #3247.Jon Leighton2011-11-031-1/+1
| | | | | Fixes creating records in a through association with a polymorphic source type.
* 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-262-2/+11
| | | | Closes #3104.
* CollectionProxy#replace should change the DB records rather than just ↵Jon Leighton2011-09-261-1/+1
| | | | mutating the array. Fixes #3020.
* Don't include any of includes, preload, joins, eager_load in the through ↵Jon Leighton2011-09-071-1/+1
| | | | association scope.
* Nested through associations: preloads from the default scope of a through ↵Jon Leighton2011-09-061-1/+1
| | | | model should not be included in the association scope. (We're already excluding includes.) Fixes #2834.
* Don't find belongs_to target when the foreign_key is NULL. Fixes #2828Georg Friedrich2011-09-051-0/+4
|
* The join_nodes must be passed to the JoinDependency initializer and ↵Jon Leighton2011-08-291-6/+12
| | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
* Ensure empty has_many :through association preloaded via joins is marked as ↵Jon Leighton2011-08-151-3/+2
| | | | loaded. Fixes #2054.
* Fix private methods which are delegated to. This previously worked because ↵Jon Leighton2011-08-152-13/+13
| | | | Module#delegate previously ignored method visibility.
* Make it the responsibility of the connection to hold onto an ARel visitor ↵Jon Leighton2011-08-082-3/+3
| | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
* Add a proxy_association method to association proxies, which can be called ↵Jon Leighton2011-07-271-6/+10
| | | | by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner.