aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Changed a few instances of of words in the API docs written in British ↵Oemuer Oezkir2011-07-241-1/+1
| | | | | | English to American English(according to Weber)
* Fix exception if old and new targets are both nil. Fixes #1471.Jon Leighton2011-07-121-1/+1
|
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2011-07-091-1/+1
|\
| * find(:first) => firstAkira Matsuda2011-07-081-1/+1
| |
* | Destroy association habtm record before destroying the record itself. Fixes ↵Tomas D'Stefano2011-07-081-12/+10
| | | | | | | | issue #402.
* | Ensure that the foreign key gets set when doing record.create_association or ↵Jon Leighton2011-07-081-2/+11
| | | | | | | | record.create_association. Fixes #1960.
* | Merge pull request #1120 from lysenko/collection_singular_idsSantiago Pastorino2011-07-061-1/+1
|\ \ | | | | | | collection_singular_ids ignores association :include option
| * | Fix bug in collection_singular_ids on has many through association with ↵Anatoliy Lysenko2011-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conditions and includes, when condtions references tables from includes. Test fail because of invalid sql: ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.id: SELECT "posts".id FROM "posts" INNER JOIN "readers" ON "posts"."id" = "readers"."post_id" WHERE "readers"."person_id" = 1 AND (comments.id is null) Bug described in github#925 This commit will revert fix from https://github.com/rails/rails/commit/3436fdfc12d58925e3d981e0afa61084ea34736c , but tests is ok. Bug described in #6569 ticket.
* | | Don't construct association scope in initializer. This yields a big ↵Jon Leighton2011-07-071-6/+10
|/ / | | | | | | performance gain for cases where the association is never used to load the target, for example with preloading. Related: #1873.
* | Merge pull request #1968 from bogdan/associations_find_array_compatibility2Santiago Pastorino2011-07-051-3/+7
|\ \ | |/ |/| Fixed CollectionAssociation#find to be compatible with Array#find
| * Fixed CollectionAssociation#find to be compatible with Array#findBogdan Gusiev2011-07-051-3/+7
| | | | | | | | | | In order to make CollectionAssociation behave closer to Array Add the ability to pass block to #find method just like Array#find does.
* | Only call set_owner_attributes for has_one association if target exists.Dieter Komendera2011-07-041-1/+1
|/
* a few minor performance improvements: fewer strings, fewer range objects, ↵Aaron Patterson2011-07-012-22/+13
| | | | fewer method calls
* remove unused codesAaron Patterson2011-07-011-4/+0
|
* reduce calls to owners_by_key and to read_attribute, respond_to? etcAaron Patterson2011-07-011-2/+3
|
* Assign the association attributes to the associated record before the ↵Jon Leighton2011-06-303-8/+10
| | | | before_initialize callback of the record runs. Fixes #1842.
* match method signature of the superclassAaron Patterson2011-06-301-3/+3
|
* cache the plural name on the reflection so we do not pay pluralize costs on ↵Aaron Patterson2011-06-301-1/+1
| | | | joins
* Replace inline lambdas with named methodsJon Leighton2011-06-121-29/+42
|
* Don't wrap operations on collection associations in transactions when they ↵benedikt2011-06-121-3/+9
| | | | are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database.
* remove warning: assigned but unused variableSantiago Pastorino2011-06-081-1/+1
|
* Allow polymorphic has_one to work when the association is set before the ↵Jon Leighton2011-06-081-3/+1
| | | | owner has been saved. Fixes #1524.
* When you add a record to a polymorphic has_one, you should be able to access ↵Jon Leighton2011-06-082-2/+2
| | | | the owner from the associated record
* Don't double assign attributes - closes #1467.Andrew White2011-06-031-1/+0
|
* added an alias for new to build to the AR collection proxy, this corrects an ↵Josh Kalderimis2011-06-012-10/+2
| | | | issue where the collection proxies were not consistent
* Only save the record once when calling create! on a collection association. ↵Jon Leighton2011-05-314-25/+45
| | | | Fixes #1360.
* Implementing @dmathieu's cleaner fix from #1425. Unfortunately he deleted ↵Jon Leighton2011-05-311-8/+5
| | | | the branch so I cannot just merge it.
* Adding comment to work with 1.8.7. Nested Attribute fix.Arun Agrawal2011-05-311-0/+3
|
* Fix nested attribute for memory record.Arun Agrawal2011-05-311-1/+5
|
* Merge pull request #1323 from fx/association_primary_keyJon Leighton2011-05-261-1/+1
|\ | | | | use association_primary_key in AssociationScope#add_constraints
| * use association_primary_key in AssociationScope#add_constraintsMarian Rudzynski2011-05-261-1/+1
| |
* | Removes the restriction on primary key when joining in a habtm && test that ↵Mohammad El-Abid2011-05-261-4/+0
|/ | | | it was properly removed
* Merge branch 'master' of github.com:rails/railsXavier Noria2011-05-252-37/+0
|\
| * removed deprecated methods, and related tests, from ActiveRecordJosh Kalderimis2011-05-252-37/+0
| |
* | Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2011-05-252-2/+2
|\ \ | |/ |/| | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/core_ext/kernel/requires.rb
| * Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-232-2/+2
| |
* | Ignore :includes on through associationsAndrew White2011-05-241-1/+1
| |
* | Fix problem with loading polymorphic associations which have been defined in ↵Jon Leighton2011-05-222-8/+22
| | | | | | | | an abstract superclass. Fixes #552.
* | Handle polymorphic_type NOT NULL-able columns as well.thedarkone2011-05-211-1/+1
| |