1. 10 11月, 2014 1 次提交
  2. 15 10月, 2014 1 次提交
  3. 23 9月, 2014 1 次提交
  4. 26 8月, 2014 1 次提交
  5. 25 8月, 2014 2 次提交
  6. 22 8月, 2014 2 次提交
  7. 21 8月, 2014 1 次提交
  8. 20 8月, 2014 1 次提交
  9. 19 8月, 2014 1 次提交
    • J
      Grammar pass · 20f7c767
      Jon Atack 提交于
      [ci skip]
      
      Add improvements from @eileencodes [skip ci]
      20f7c767
  10. 14 8月, 2014 2 次提交
  11. 13 8月, 2014 1 次提交
  12. 09 8月, 2014 1 次提交
  13. 08 8月, 2014 1 次提交
  14. 21 7月, 2014 1 次提交
  15. 15 7月, 2014 1 次提交
  16. 08 7月, 2014 1 次提交
    • E
      Begin refactoring ThroughReflection · f8d2899d
      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.
      f8d2899d
  17. 05 7月, 2014 1 次提交
    • S
      Add a `required` option to singular associations · 00f55516
      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.
      00f55516
  18. 10 6月, 2014 2 次提交
    • A
      Use HasAndBelongsToMany instead of HABTM · 34c77bcf
      Arthur Neves 提交于
      34c77bcf
    • E
      Abstract away use of HABTM macro · 9eb87fbf
      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.
      9eb87fbf
  19. 27 5月, 2014 1 次提交
    • A
      Refactoring .reflections public method. · 00b02421
      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.
      00b02421
  20. 25 5月, 2014 2 次提交
  21. 23 5月, 2014 1 次提交
  22. 11 5月, 2014 1 次提交
  23. 10 5月, 2014 1 次提交
  24. 09 5月, 2014 1 次提交
  25. 03 5月, 2014 1 次提交
  26. 29 4月, 2014 2 次提交
  27. 26 4月, 2014 1 次提交
    • K
      Fix custom join_table name on habtm reflections · 18fa87b8
      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.
      18fa87b8
  28. 31 3月, 2014 1 次提交
    • T
      Simplify Preloader#grouped_records code. · 055942d6
      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.
      055942d6
  29. 15 3月, 2014 1 次提交
  30. 04 3月, 2014 1 次提交
  31. 27 2月, 2014 1 次提交
  32. 14 2月, 2014 1 次提交
  33. 03 2月, 2014 2 次提交