aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed that records returned from has_and_belongs_to_many associations with ↵David Heinemeier Hansson2006-04-011-3/+9
| | | | | | additional attributes should be marked as read only (fixes #4512) [DHH] DEPRECATED: Using additional attributes on has_and_belongs_to_many associations. Instead upgrade your association to be a real join model [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4123 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Do not implicitly mark recordss of has_many :through as readonly but do mark ↵Marcel Molina2006-03-301-1/+1
| | | | | | habtm records as readonly (eventually only on join tables without rich attributes). git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Changed has_and_belongs_to_many join to INNER JOIN for Mysql 3.23.x. Closes ↵Rick Olson2006-03-261-1/+1
| | | | | | #4348 [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4038 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed issue that kept :select options from being scoped [Rick]Rick Olson2006-03-261-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change has_many :through to use the :source option to specify the source ↵Rick Olson2006-03-241-1/+1
| | | | | | association. :class_name is now ignored. [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow overriding of find parameters in scoped has_many :through calls [Rick ↵Rick Olson2006-03-211-9/+9
| | | | | | Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4007 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quit ignoring default :include options in has_many :through calls [Mark James]Rick Olson2006-03-191-5/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow has_many :through to work on has_many associations (closes #3864) ↵Rick Olson2006-03-191-17/+36
| | | | | | [sco@scottraymond.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3964 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise error when trying to select many polymorphic objects with has_many ↵Rick Olson2006-03-192-24/+10
| | | | | | :through or :include (closes #4226) [josh@hasmanythrough.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed has_many :through to include :conditions set on the :through ↵Rick Olson2006-03-181-5/+19
| | | | | | association. closes #4020 [jonathan@bluewire.net.nz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that has_many :through honors the foreign key set by the belongs_to ↵Rick Olson2006-03-181-2/+5
| | | | | | association in the join model (closes #4259) [andylien@gmail.com / Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3954 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update lingering uses of deprecated association dependency options (closes ↵David Heinemeier Hansson2006-03-181-1/+1
| | | | | | #4169) [coffe2code] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fixed has_many :conditions sanitizing (closes #4278) [hakuja@hakuja.net]Rick Olson2006-03-181-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nicer error message on has_many :through when :through reflection can not be ↵David Heinemeier Hansson2006-03-181-1/+3
| | | | | | found (closes #4042) [court3nay@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* remove some commented-out cruftRick Olson2006-03-161-4/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use association's :conditions when eager loading. [jeremyevans0@gmail.com] ↵Rick Olson2006-03-167-12/+24
| | | | | | closes #4144 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.abstract_class? that marks which classes are not part of the ↵Rick Olson2006-03-165-5/+5
| | | | | | Active Record hierarchy. closes #3704 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix counter cache setting in belongs-to proxyJamis Buck2006-03-091-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3828 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make counter cache work when replacing an association (closes #3245). Thanks ↵Jamis Buck2006-03-041-0/+11
| | | | | | for the patch! git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3762 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that calling HasOneProxy#build_model repeatedly would cause saving to ↵David Heinemeier Hansson2006-03-031-1/+1
| | | | | | happen (closes #4058) [anna@wota.jp] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* save polymorphic joins from the has_many|one association (closes #3812) ↵David Heinemeier Hansson2006-02-123-4/+12
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow has_many :through to work with :include [Michael Schoen]. Closes #3611Michael Koziarski2006-02-101-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3566 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Polymorphic join support for has_one associations (has_one :foo, :as => ↵Jeremy Kemper2006-02-091-2/+8
| | | | | | :bar). Closes #3785. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3558 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Using AssociationCollection#build with arrays of hashes should call build, ↵David Heinemeier Hansson2006-02-031-1/+1
| | | | | | not create [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* allow has_many :through to work with custom :foreign key (closes #3422) ↵David Heinemeier Hansson2006-01-211-2/+1
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix .count for has_many associations with multi-line finder-sql. Closes #3540 Michael Koziarski2006-01-212-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3450 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* removed :piggyback in favor of just allowing :select on :through associationsTobias Lütke2005-12-201-5/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* made .find() and class method delegation work on :through relationsTobias Lütke2005-12-201-2/+33
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* added :piggyback option to has_many :through relationships to pick up values ↵Tobias Lütke2005-12-201-1/+9
| | | | | | from the join table as needed git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed :through relations when using STI inherited classes would use the ↵Tobias Lütke2005-12-161-1/+2
| | | | | | inherited class's name as foreign key on the join model git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added option inheritance for find calls on has_and_belongs_to_many and ↵David Heinemeier Hansson2005-12-134-10/+24
| | | | | | | | has_many assosociations [DHH] Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH] Added form_remote_for (form_for meets form_remote_tag) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3287 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added tests for join models and fixed a bug #3177David Heinemeier Hansson2005-12-111-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix has_many :throughDavid Heinemeier Hansson2005-12-071-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added preliminary support for join models [DHH] Added preliminary support ↵David Heinemeier Hansson2005-12-038-215/+244
| | | | | | for polymorphic associations [DHH] Refactored associations to use reflections to get DRYer, beware, major refactoring -- double check before deploying anything with this (all tests pass, but..) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Work-in progress for providing better join model support and polymorphic ↵David Heinemeier Hansson2005-12-024-12/+84
| | | | | | associations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_and_belongs_to_many: use JOIN instead of LEFT JOIN. References #2937.Jeremy Kemper2005-11-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't add the same conditions twice in has_one finder sql. References #2916.Jeremy Kemper2005-11-171-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Associations handle case-equality more consistently: item.parts.is_a?(Array) ↵Jeremy Kemper2005-11-151-5/+12
| | | | | | and item.parts === Array. Closes #1345. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :group option, correspond to GROUP BY, to the find method and to the ↵Jeremy Kemper2005-11-101-1/+2
| | | | | | has_many association. Closes #2818. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :include as an option for association declarations [DHH]David Heinemeier Hansson2005-11-064-9/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r2915@asus: jeremy | 2005-11-06 05:02:53 -0800Jeremy Kemper2005-11-062-4/+9
| | | | | | | Rename Base.constrain to Base.with_scope so it doesn't conflict with existing concept of database constraints. Make scoping more robust: uniform method => parameters, validated method names and supported finder parameters, raise exception on nested scopes. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added extension capabilities to has_many and has_and_belongs_to_many proxies ↵David Heinemeier Hansson2005-11-043-8/+24
| | | | | | [DHH] Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH] Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added extension capabilities to has_many and has_and_belongs_to_many proxies ↵David Heinemeier Hansson2005-11-031-2/+5
| | | | | | [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2861 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3800@sedna: jeremy | 2005-10-28 00:39:05 -0700Jeremy Kemper2005-10-281-1/+1
| | | | | | | Readonly constraints, association collection method_missing, dup constraint options git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Associations#clear for not-yet-loaded associations (Patrick Lenz)Tobias Lütke2005-10-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2695 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HABTM finder sets :readonly => false. Closes #2525.Jeremy Kemper2005-10-201-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2694 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Parenthesize :conditionsJeremy Kemper2005-10-183-6/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix bad commit. (Bad developer, bad\!)Nicholas Seckar2005-10-161-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2633 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add __FILE__ and __LINE__ to evalNicholas Seckar2005-10-151-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2629 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DRYed up Associations#clear. Closes #1906 [Caleb]Tobias Lütke2005-10-143-34/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de