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

19 commits

Author SHA1 Message Date
Jakub Kuźma
1ad0a5363b added failing tests for has_many, has_one and belongs_to associations with strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051 2011-12-21 21:10:15 +01:00
Andrew White
5d655aabcb Pass mass-assignment options to nested models - closes #1673. 2011-06-13 13:02:51 +01:00
Josh Kalderimis
86d7ed3375 singular and collection relations in AR can now specify mass-assignment security options (:as and :without_protection) in build, create and create! methods. 2011-05-01 23:30:07 +02:00
Josh Kalderimis
a08d04bedf Added assign_attributes to Active Record which accepts a mass-assignment security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected 2011-04-24 09:53:18 +02:00
Jon Leighton
735844db71 Merge branch 'master' into nested_has_many_through
Conflicts:
	activerecord/CHANGELOG
	activerecord/lib/active_record/association_preload.rb
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/class_methods/join_dependency.rb
	activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
	activerecord/lib/active_record/associations/has_many_association.rb
	activerecord/lib/active_record/associations/has_many_through_association.rb
	activerecord/lib/active_record/associations/has_one_association.rb
	activerecord/lib/active_record/associations/has_one_through_association.rb
	activerecord/lib/active_record/associations/through_association_scope.rb
	activerecord/lib/active_record/reflection.rb
	activerecord/test/cases/associations/has_many_through_associations_test.rb
	activerecord/test/cases/associations/has_one_through_associations_test.rb
	activerecord/test/cases/reflection_test.rb
	activerecord/test/cases/relations_test.rb
	activerecord/test/fixtures/memberships.yml
	activerecord/test/models/categorization.rb
	activerecord/test/models/category.rb
	activerecord/test/models/member.rb
	activerecord/test/models/reference.rb
	activerecord/test/models/tagging.rb
2011-03-04 09:30:27 +00:00
Jon Leighton
91fd651056 Allow building and then later saving has_many :through records, such that the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [#4329 state:resolved] 2011-02-18 00:00:13 +00:00
Jon Leighton
05bcb8cecc Support the :dependent option on has_many :through associations. For historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association. 2011-02-07 23:35:05 +00:00
Ernie Miller
5d37ff6bb2 Fix hm:t to self table aliasing in construct_scope 2010-12-16 01:49:29 +05:30
Jon Leighton
9a1a32ac2b Fix naughty trailing whitespace 2010-10-31 11:21:28 +00:00
Jon Leighton
ab5a933502 Add support for nested through associations in JoinAssociation. Hence Foo.joins(:bar) will work for through associations. There is some duplicated code now, which will be refactored. 2010-10-09 22:00:33 +01:00
José Valim
7131244313 Ensure default_scope can be overwriten by association conditions. 2010-07-21 15:06:23 +02:00
Subba Rao Pasupuleti
d77c3b669c eagerly loaded association records should respect default_scope [#2931 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-21 15:01:40 +02:00
Pratik Naik
d60bb0a9e4 Rename named_scope to scope 2010-01-18 04:38:19 +05:30
Benjamin Floering
27de7f150b Fixed limited eager loading associations with numbers in the name [#2668 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-05-18 13:56:17 +02:00
Frederick Cheung
5cebe69e74 Preload uses exclusive scope [#643 state:resolved]
With self referential associations, the scope for the the top level should not affect fetching of associations, for example
when doing

Person.male.find :all, :include => :friends

we should load all of the friends for each male, not just the male friends.
2008-12-26 18:25:55 +00:00
Brandon Keepers
e94e53f9cd fix eager loading with dynamic finders 2008-06-09 12:05:20 -04:00
Frederick Cheung
44d2142352 Ensure table names are quoted by the association preloading code.
[#45 state:resolved]

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-04-26 12:14:50 +12:00
Michael Koziarski
f2546164d6 Make dynamic finders respect the :include on HasManyThrough associations. Closes #10998. [cpytel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-18 00:14:54 +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/person.rb (Browse further)