1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

21 commits

Author SHA1 Message Date
Carlos Antonio da Silva
47d252f992 Fix associations to call :destroy or :delete based on the right :dependent option
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-09 00:11:34 +01:00
José Valim
2ea1d684d9 Refactor new callbacks and AR implementation.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Gabe da Silveira
00d6c76660 Enable has_many :through for going through a has_one association on the join model [#2719 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 00:30:44 +01:00
Szymon Nowak
1c11437a32 Add primary_key option to belongs_to association
[#765 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-07-15 18:13:32 -07:00
Pratik Naik
de0ea38663 Ensure :dependent => :delete_all works for association with hash conditions 2009-04-20 18:12:40 +01:00
Pratik Naik
489abfd3b2 Ensure JoinAssociation uses aliased table name when multiple associations have hash conditions on the same table 2009-04-20 13:51:11 +01:00
miloops
97403ad5fd Add :having option to find, to use in combination with grouped finds. Also added to has_many and has_and_belongs_to_many associations.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1028 state:committed]
2008-12-01 20:22:31 +01:00
Will Bryant
4c05055487 explicitly including child associations that are also included in the parent association definition should not result in double records in the collection/double loads (#1110)
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1110 state:committed]
2008-10-10 16:58:39 +02:00
Pratik Naik
9994f0d902 Revert "Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved]"
This reverts commit e0750d6a5c.

Conflicts:

	activerecord/CHANGELOG
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/association_collection.rb
2008-09-10 18:50:01 +01:00
Tarmo Tänav
7c9851dbb6 Support :limit on update_all so that has_many with :limit can be safely updated
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-10 13:41:49 +02:00
Tarmo Tänav
96607996ea Test for eager loading of STI subclasses from htm associations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-08-16 22:26:11 +01:00
David Dollar
e0750d6a5c Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved]
Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate
ActiveRecord models.

class Post < ActiveRecord::Base
  belongs_to :author,   :accessible => true
  has_many   :comments, :accessible => true
end

post = Post.create({
  :title    => 'Accessible Attributes',
  :author   => { :name => 'David Dollar' },
  :comments => [
    { :body => 'First Post!' },
    { :body => 'Nested Hashes are great!' }
  ]
})

post.comments << { :body => 'Another Comment' }

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-14 02:53:21 +01:00
Brandon Keepers
e94e53f9cd fix eager loading with dynamic finders 2008-06-09 12:05:20 -04:00
Frederick Cheung
3f0dccbbc7 Ensure hm:t preloading honours reflection options. [#137 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-11 20:01:14 +01:00
David Heinemeier Hansson
bdd88810c1 Fixed that has_many :through would ignore the hash conditions (closes #11447) [miloops]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 16:13:57 +00:00
Rick Olson
081ddb6f24 Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-24 02:50:02 +00:00
Pratik Naik
e117350037 Add :readonly option to HasManyThrough associations. Closes #11156 [miloops]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-07 11:45:07 +00:00
Jeremy Kemper
78253acb59 Revert r8742: remove has_many with :group option since it has sketchy sql support. Closes #10480.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-03 01:09:58 +00:00
Michael Koziarski
9500ad5fbc Make sure count works on has_many :through associations using :group. Closes #10480 [remvee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-27 02:41:55 +00:00
Jeremy Kemper
16b129a68c belongs_to supports :dependent => :destroy and :delete. Closes #10592.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 05:30:42 +00:00
Jeremy Kemper
43b81d01d0 move assets and models
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00
Renamed from activerecord/test/fixtures/author.rb (Browse further)