- 22 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 21 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 20 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 14 8月, 2014 2 次提交
-
-
由 Zachary Scott 提交于
-
由 Tom Kadwill 提交于
-
- 13 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 09 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 08 8月, 2014 1 次提交
-
-
由 Tom Kadwill 提交于
-
- 21 7月, 2014 1 次提交
-
-
由 vadivelan 提交于
-
- 15 7月, 2014 1 次提交
-
-
由 Guo Xiang Tan 提交于
-
- 08 7月, 2014 1 次提交
-
-
由 eileencodes 提交于
This allows us to decouple AssociationReflection and ThroughReflection making ThroughReflection it's own Reflection bucket in a way. The benefit of this is to be able to remove checks against the macro's symbol for exmaple `macro == :belongs_to`. Get all tests passing again Some of the methods that used to be inherited from MacroReflection through AssociationReflection were no longer getting passed through. They needed to be duplicated into the ThroughReflection. I will extract these out into a separate class. Refactor shared methods into strategy object Now that we've separated ThroughReflection and AssociationReflection we can combine shared methods into one class to avoid duplication. Break out class for each type of reflection This creates a class for each reflection type (has_many, has_one, belongs_to and habtm). We then can remove the need to set the macro symbol in each initialization. Tests were updated to reflect these changes because creation of these reflections is now different. Remove need for @collection instance var We now define `collection?` as `false` by default and set it to `true` in `has_and_belongs_to_many` and `has_many` reflections. This removes the need for the `@collection` instance variable. Raise exception on unknown macro types We shouldn't accept just any macro when creating reflections. An unrecongnized AssociationReflection raises an error. Tests in `reflection_test` were updated to reflect these new changes. `:has_and_belongs_to_many` macro tests were removed because we no longer internally return HABTM.
-
- 05 7月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
In addition to defining the association, a `required` association will also have its presence validated. Before: ```ruby belongs_to :account validates_presence_of :account ``` After: ```ruby belongs_to :account, required: true ``` This helps to draw a distinction between types of validations, since validations on associations are generally for data integrity purposes, and aren't usually set through form inputs.
-
- 10 6月, 2014 2 次提交
-
-
由 Arthur Neves 提交于
-
由 eileencodes 提交于
By having the `:has_and_belongs_to_many` macro in the `@collection` we are punishing `:has_many` associations because it has to allocate the array and check the macro. @collection is returned to `macro == :has_many` and a new reflection class `HABTMReflection` is created to handle this case instead.
-
- 27 5月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
Now the internal reflections will hold a reference to its public representation, so when the outside world calls `Account.reflection` we can build a list of public reflections.
-
- 25 5月, 2014 2 次提交
-
-
由 Arthur Neves 提交于
-
由 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
-
- 23 5月, 2014 1 次提交
-
-
由 danielmbarlow 提交于
Should make it a little easier to find the information. Also added note to look below for the definition of the generated methods.
-
- 11 5月, 2014 1 次提交
-
-
由 Yves Senn 提交于
-
- 10 5月, 2014 1 次提交
-
-
由 Yves Senn 提交于
Closes #15024. These operations happen before instances are created. The current behavior is misleading and can result in broken behavior.
-
- 09 5月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
I wanted the middle model to be anonymous, but we have to give it a name for marshal support. :'(
-
- 03 5月, 2014 1 次提交
-
-
由 Yves Senn 提交于
This is a follow up to #14139. /cc @carlosantoniodasilva
-
- 29 4月, 2014 2 次提交
-
-
由 Yves Senn 提交于
-
由 anilmaurya 提交于
-
- 26 4月, 2014 1 次提交
-
-
由 Kassio Borges 提交于
When used a custom join_table name on a habtm, rails was not saving it on Reflections. This causes a problem when rails loads fixtures, because it uses the reflections to set database with fixtures.
-
- 31 3月, 2014 1 次提交
-
-
由 thedarkone 提交于
The new method relies on AR::Associations::Association knowing about both reflection and a model class. AR::Base#association now raises a descriptive error when trying to access non-existent associations. Previously it would blow up with a confusing NoMethodError: undefined method `association_class' for nil:NilClass.
-
- 15 3月, 2014 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Fixes #14383.
-
- 04 3月, 2014 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 27 2月, 2014 1 次提交
-
-
由 Logan Hasson 提交于
Make explanation of association class methods clearer by moving notes to beginning of each example section.
-
- 14 2月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 03 2月, 2014 4 次提交
- 28 1月, 2014 1 次提交
-
-
由 Vipul A M 提交于
Add docs about behaviour of replacing a has_one associate object, that the previous one is deleted even if the new one doesn't get persisted to database. Fixes #13197 . [ci skip]
-
- 04 1月, 2014 1 次提交
-
-
由 T.J. Schuck 提交于
-
- 03 10月, 2013 4 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-