- 18 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
If the through record gets created in an `after_create` hook that is defined before the association is defined (therefore after its `after_create` hook) get saved twice. This ensures that the through records are created only once, regardless of the order of the hooks.
-
- 10 6月, 2014 1 次提交
-
-
由 eileencodes 提交于
Instead of checking for `macro == :has_one` throughout the codebase we can create a `has_one?` method to match the `belongs_to?`, `polymorphic?` and other methods.
-
- 27 5月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
After ad7b5efb, which changed how has_an_belongs_to_many used to work, we start raising an error when redefining the same has_an_belongs_to_many association. This commits fix that regression. [Fixes #14983]
-
- 25 5月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
Fix habtm reflection Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/reflection_test.rb
-
- 21 5月, 2014 1 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit e94e6c27. Conflicts: activerecord/CHANGELOG.md The original commit was reverted only to be safe since #14407 were reported. We don't have any proof we added a regression with the original commit so reverting it now will give us more problem. Closes #14407
-
- 01 5月, 2014 1 次提交
-
-
由 Eric Chahin 提交于
associations were not being saved. Fixes #13854. [Eric Chahin, Aaron Nelson, & Kevin Casey]
-
- 11 4月, 2014 1 次提交
-
-
由 Yves Senn 提交于
[ci skip] The examples are written in a way you expect them to be executable. However one snippet assumed there to be two comments when only one was created above. The defined models did not extend `ActiveRecord::Base` The example used `comments.last.mark_for_destruction`. This does no longer load the whole collection but just the last record. It is then refetcht on subsequent calls to `last`. This breaks the example.
-
- 26 3月, 2014 1 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 6e3ab3e1, reversing changes made to 39e07b64. Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/autosave_association_test.rb
-
- 21 2月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
This reverts commit 5e3d466d.
-
- 09 2月, 2014 1 次提交
-
-
由 Kevin Casey 提交于
-
- 01 11月, 2013 1 次提交
-
-
由 Alan Kennedy 提交于
Prevents save related callbacks such as `after_commit` being triggered when `has_one` objects are already persisted and have no changes.
-
- 25 10月, 2013 1 次提交
-
-
由 laurocaetano 提交于
-
- 17 10月, 2013 2 次提交
-
-
由 Arthur Neves 提交于
-
由 Arthur Neves 提交于
-
- 23 7月, 2013 2 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 16 7月, 2013 1 次提交
-
-
由 Paul Nikitochkin 提交于
Closes #11450
-
- 03 6月, 2013 1 次提交
-
-
由 José Valim 提交于
This behaviour doesn't actually make sense, the context of the child should not be affected by the parent. See #10492. This reverts commit 5f8274ef, reversing changes made to 81e837e8.
-
- 02 5月, 2013 1 次提交
-
-
由 Johnny Holton 提交于
fixes bug introduced by #3329 These are the conditions necessary to reproduce the bug: - For an association, autosave => true. - An association record is being destroyed - A new association record is being created. - There is a unique index one of the association's fields. - The record being created has the same value as the record being destroyed on the indexed field. Before, the deletion of records was postponed until after all insertions/saves. Therefore the new record with the identical value in the indexed field caused a non-unique value error to be thrown at the database level. With this fix, the deletions happen first, before the insertions/saves. Therefore the record with the duplicate value is gone from the database before the new record is created, thereby avoiding the non-uniuqe value error.
-
- 19 4月, 2013 2 次提交
-
-
由 Jon Leighton 提交于
This reverts commit e8727d37, reversing changes made to d098e1c2. Reason: it broke the mysql build
-
由 Johnny Holton 提交于
fixes bug introduced by #3329 These are the conditions necessary to reproduce the bug: - For an association, autosave => true. - An association record is being destroyed - A new association record is being created. - There is a unique index one of the association's fields. - The record being created has the same value as the record being destroyed on the indexed field. Before, the deletion of records was postponed until after all insertions/saves. Therefore the new record with the identical value in the indexed field caused a non-unique value error to be thrown at the database level. With this fix, the deletions happen first, before the insertions/saves. Therefore the record with the duplicate value is gone from the database before the new record is created, thereby avoiding the non-uniuqe value error.
-
- 17 4月, 2013 1 次提交
-
-
由 Neeraj Singh 提交于
Emphasizing that without autosave option only new records are saved and updated records are not saved
-
- 03 4月, 2013 1 次提交
-
-
由 Sam Ruby 提交于
-
- 21 3月, 2013 1 次提交
-
-
由 Ian Young 提交于
-
- 26 2月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 18 1月, 2013 2 次提交
-
-
由 Guillermo Iguaran 提交于
This reverts commit 637a7d9d, reversing changes made to 5937bd02.
-
由 robertomiranda 提交于
-
- 02 12月, 2012 1 次提交
-
-
由 Alvaro Pereyra 提交于
-
- 09 11月, 2012 1 次提交
-
-
由 AvnerCohen 提交于
-
- 14 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 12 5月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association.
-
- 18 3月, 2012 1 次提交
-
-
由 Jared Armstrong 提交于
Fix bug with autosave collection association on new record with a marked for destroy record in autosave collection.
-
- 17 3月, 2012 1 次提交
-
-
由 Jonathan R. Wallace 提交于
-
- 14 3月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 03 3月, 2012 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
* Avoid double hash lookups in AR::Reflection when reflecting associations/aggregations * Minor cleanups: use elsif, do..end, if..else instead of unless..else * Simplify DynamicMatchers#respond_to? * Use "where" instead of scoped with conditions hash * Extract `scoped_by` method pattern regexp to constant * Extract noisy class_eval from method_missing in dynamic matchers * Extract readonly check, avoid calling column#to_s twice in persistence * Refactor predicate builder, remove some variables
-
由 James Coleman 提交于
To avoid foreign key errors (and invalid data) in the database, when a belongs_to association is destroyed, it should also be nil'd out on the parent object.
-
- 23 2月, 2012 2 次提交
-
-
由 Dimitar Dimitrov 提交于
Reverts a part of 91148936. Should probably be squashed with it when merging back in rails/rails.
-
由 Dimitar Dimitrov 提交于
* Fix typos * Remove meaningless code from the examples
-
- 17 1月, 2012 1 次提交
-
-
由 Emmanuel Oga 提交于
E.G.: ```ruby class Parent < ActiveRecord::Base has_one :child validates_presence_of :name, :on => "custom_context" validates_associated :child end class Child < ActiveRecord::Base belongs_to :parent validates_presence_of :name, :on => "custom_context" end p = Parent.new(:name => "Montoto", :child => Child.new) p.valid?(:custom_context) # => Returns true, even though the child is not valid under the same context. ```
-
- 06 1月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
-