aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
Commit message (Collapse)AuthorAgeFilesLines
* Move the code which builds a scope for through associations into a generic ↵Jon Leighton2011-03-101-22/+0
| | | | AssociationScope class which is capable of building a scope for any association.
* Delegate Association#options to the reflection, and replace ↵Jon Leighton2011-02-211-3/+3
| | | | 'reflection.options' with 'options'. Also add through_options and source_options methods for through associations.
* Associations - where possible, call attributes methods rather than directly ↵Jon Leighton2011-02-211-14/+14
| | | | accessing the instance variables
* Split AssociationProxy into an Association class (and subclasses) which ↵Jon Leighton2011-02-181-19/+17
| | | | manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
* Get rid of AssociationCollection#save_recordJon Leighton2011-02-141-5/+3
|
* Add interpolation of association conditions back in, in the form of proc { ↵Jon Leighton2011-02-141-2/+2
| | | | ... } rather than instance_eval-ing strings
* Refactor the implementations of AssociatioCollection#delete and #destroy to ↵Jon Leighton2011-02-071-1/+1
| | | | be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
* Make record.association.destroy(*records) on habtm and hm:t only delete ↵Jon Leighton2011-02-071-1/+1
| | | | records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
* @join_table_name is no longer usedJon Leighton2011-01-301-2/+1
|
* Let's be less blasé about method visibility on association proxiesJon Leighton2011-01-301-9/+10
|
* Removed support for accessing attributes on a has_and_belongs_to_many join ↵Jon Leighton2011-01-161-62/+6
| | | | table. This has been documented as deprecated behaviour since April 2006. Please use has_many :through instead. A deprecation warning will be added to the 3-0-stable branch for the 3.0.4 release.
* Construct an actual ActiveRecord::Relation object for the association scope, ↵Jon Leighton2011-01-071-8/+8
| | | | 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.
* avoid creating so many Arel::Table objectsAaron Patterson2011-01-051-6/+9
|
* we have a method for this, so let's use itAaron Patterson2011-01-051-2/+2
|
* use arel ast construction rather than generating stringsAaron Patterson2011-01-051-1/+7
|
* use arel to construct AST rather than generate stringsAaron Patterson2011-01-051-2/+3
|
* Explicitly select * from has_and_belongs_to_many association tables, ↵Raimonds Simanovskis2011-01-041-1/+2
| | | | | simplify exists? query Previous version (after commit 3103296a61709e808aa89c3d37cf22bcdbc5a675) was generating wrong SQL for Oracle when calling exists? method on HABTM association.
* Create the association scope directly rather than going through with_scopeJon Leighton2011-01-031-1/+1
|
* Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵Jon Leighton2011-01-031-15/+19
| | | | removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
* Rename AssociationReflection#primary_key_name to foreign_key, since the ↵Jon Leighton2010-12-311-2/+2
| | | | options key which it relates to is :foreign_key
* Refactor we_can_set_the_inverse_on_this? to use a less bizarre name amongst ↵Jon Leighton2010-12-261-0/+4
| | | | other things
* Associations: DRY up the code which is generating conditions, and make it ↵Jon Leighton2010-12-261-4/+6
| | | | all use arel rather than SQL strings
* Remove unnecessary overloaded methods create, create! and create_record from ↵Jon Leighton2010-12-201-18/+0
| | | | HasAndBelongsToManyAssociation
* Specify insert_record with NotImplementedError in AssociationCollection, to ↵Jon Leighton2010-12-201-5/+1
| | | | indicate that subclasses should implement it. Also add save_record to reduce duplication.
* remove calls to deprecated methodsAaron Patterson2010-12-021-2/+3
|
* removing some calls to insert on arelAaron Patterson2010-12-021-3/+4
|
* Partialy revert f1c13b0dd7b22b5f6289ca1a09f1d7a8c7c8584bJosé Valim2010-11-281-2/+2
|
* Remove explicit return.Emilio Tagua2010-11-251-2/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-1/+1
| | | | | | | | | | | - 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>
* Refactoring: replace the mix of variables like @finder_sql, @counter_sql, ↵Jon Leighton2010-10-301-19/+18
| | | | etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly.
* Perf: refactor method.Emilio Tagua2010-09-221-11/+8
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* do not pass nil values to arelAaron Patterson2010-09-211-1/+1
|
* mark SQL literals as SQL literalsAaron Patterson2010-08-251-1/+1
|
* marking sql literals as sql literalsAaron Patterson2010-08-231-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-3/+3
| | | | 's/[ \t]*$//' -i {} \;)
* Removing most of the symbol to proc usage in Active RecordPrem Sichanugrist2010-08-131-1/+1
| | | | This will hopefully make Active Record run a bit more faster.
* do not use arel constants directlyAaron Patterson2010-08-131-1/+1
|
* symbol to proc is slow, we should avoid itAaron Patterson2010-08-131-1/+1
|
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-3/+4
|
* Ensure all join table attributes will be in the same timestamp.José Valim2010-07-211-11/+21
|
* Timestamp columns of HABTM join table should record timestampsNeeraj Singh2010-07-211-1/+5
| | | | [#5161 state:resolved]
* id is a public methodSantiago Pastorino2010-07-211-2/+2
|
* Ensure that primary_keys of HABTM records is not double quotedNeeraj Singh2010-07-201-2/+2
| | | | [#5152 state:reslved]
* Adds title to activerecord/lib/active_record/associations/*Rizwan Reza2010-06-161-0/+1
|
* save(false) is gone, use save(:validate => false) instead.José Valim2010-01-171-1/+1
|
* Use Arel::Table instead of ActiveRecord::Relation from HABTM and ↵Pratik Naik2010-01-011-3/+3
| | | | has_many#delete_records
* Add Relation#delete [Pratik Naik, Emilio Tagua]Pratik Naik2010-01-011-1/+1
|
* Rename Model.conditions and relation.conditions to .wherePratik Naik2009-12-261-1/+1
|
* Revert "Revert "Assert primary key does not exist in habtm when the ↵Jeremy Kemper2009-11-231-13/+1
| | | | | | | | | | | | | association is defined, instead of doing that everytime a record is inserted."" This reverts commit 2b82708b0efb3a3458e8177beab58f0c585788ae. [#3128 state:resolved] Conflicts: activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
* Revert "Split arel_table into method to get a relation and another to ↵Jeremy Kemper2009-11-131-2/+2
| | | | | | memoize the default relation." This reverts commit bd51790895fc75a3b4e19e8dd7aa6dc389d77068.