1. 14 8月, 2020 1 次提交
    • D
      Replace test `Man` with `Human` · 7f938cac
      Daniel Colson 提交于
      The commit replaces the `Man` model used in tests with a `Human` model. It
      also replaces the existing `Human` model with a `SuperHuman` model
      inheriting from `Human`.
      
      While this may seem like a cosmetic change, I see it as more of an
      inclusivity change. I think it makes sense for a number of reasons:
      
      * Prior to this commit the `Human` model inherited from `Man`. At best
        this makes no sense (it should be the other way around). At worst it
        is offensive and harmful to the community.
      * It doesn't seem inclusive to me to have exclusively male-gendered
        examples in the codebase.
      * There is no particular reason for these examples to be gendered.
      * `man` is hard to grep for, since it also matches `many, manager,
        manual, etc`
      
      For the most part this is a simple search and replace. The one exception
      to that is that I had to add the table name to the model so we could use
      "humans" instead of "humen".
      7f938cac
  2. 26 7月, 2019 1 次提交
  3. 28 5月, 2019 1 次提交
  4. 22 5月, 2019 1 次提交
  5. 21 12月, 2018 1 次提交
  6. 16 10月, 2018 1 次提交
    • A
      Add regression test against habtm memoized singular_ids · 5e92770e
      Alberto Almagro 提交于
      Starting in Rails 5.0.0 and still present in Rails 5.2.1, `singular_ids`
      got memoized and didn't reload after more items were added to the
      relation.
      
      Although 19c80718 happens to fix the issue, it only adds tests for
      `has_many` relations while this bug only affected
      `has_and_belongs_to_many` relations.
      
      This commit adds a regression test to ensure it never happens again with
      `habtm` relations.
      
      Ensures #34179 never gets reproduced.
      5e92770e
  7. 15 10月, 2018 1 次提交
  8. 09 10月, 2018 1 次提交
  9. 05 10月, 2018 2 次提交
  10. 13 8月, 2018 1 次提交
    • R
      Fix numericality validator not to be affected by custom getter · 2fece903
      Ryuta Kamizono 提交于
      Since fe9547b6, numericality validator would parse raw value only when a
      value came from user to work type casting to a value from database.
      
      But that was caused a regression that the validator would work against
      getter value instead of parsed raw value, a getter is sometimes
      customized by people. #33550
      
      There we never guarantees that the value before type cast was going to
      the used in this validation (actually here is only place that getter
      value might not be used), but we should not change the behavior unless
      there is some particular reason.
      
      The purpose of fe9547b6 is to work type casting to a value from
      database. We could achieve the purpose by using `read_attribute`,
      without using getter value.
      
      Fixes #33550.
      2fece903
  11. 26 6月, 2018 1 次提交
  12. 19 4月, 2018 1 次提交
  13. 18 2月, 2018 1 次提交
  14. 26 1月, 2018 3 次提交
  15. 09 11月, 2017 2 次提交
  16. 24 10月, 2017 1 次提交
  17. 20 7月, 2017 1 次提交
  18. 02 7月, 2017 1 次提交
  19. 01 7月, 2017 1 次提交
  20. 31 5月, 2017 1 次提交
  21. 23 5月, 2017 1 次提交
  22. 21 4月, 2017 1 次提交
  23. 06 2月, 2017 1 次提交
    • B
      Correct spelling · c8b5d828
      Benjamin Fleischer 提交于
      ```
      go get -u github.com/client9/misspell/cmd/misspell
      misspell  -w -error -source=text .
      ```
      c8b5d828
  24. 10 1月, 2017 1 次提交
    • K
      Deprecate reflection class name to accept a class · 8312a0d2
      Kir Shatrov 提交于
      The idea of `class_name` as an option of reflection is that passing a
      string would allow us to lazy autoload the class.
      
      Using `belongs_to :client, class_name: Customer` is eagerloading models more than necessary
      and creating possible circular dependencies.
      8312a0d2
  25. 30 12月, 2016 1 次提交
  26. 13 11月, 2016 1 次提交
    • R
      Respect new records for `CollectionProxy#uniq` · 0ec967aa
      Ryuta Kamizono 提交于
      Currently if `CollectionProxy` has more than one new record,
      `CollectionProxy#uniq` result is incorrect.
      
      And `CollectionProxy#uniq` was aliased to `distinct` in a1bb6c8b.
      But the `uniq` method and the `SELECT DISTINCT` method are different
      methods. The doc in `CollectionProxy` is for the `SELECT DISTINCT`
      method, not for the `uniq` method.
      
      Therefore, reverting the alias in `CollectionProxy` to fix the
      inconsistency and to have the both methods.
      0ec967aa
  27. 29 10月, 2016 1 次提交
  28. 27 10月, 2016 1 次提交
    • M
      Fix HABTM associations join table resolver bug on constants and symbols · 94821b4b
      Mehmet Emin İNAÇ 提交于
      Using Constant and symbol class_name option for associations are valid but raises exception on HABTM associations.
      There was a test case which tries to cover symbol class_name usage but doesn't cover correctly. Fixed both symbol usage and constant usage as well.
      
      These are all working as expected now;
      ```
        has_and_belongs_to_many :foos, class_name: 'Foo'
        has_and_belongs_to_many :foos, class_name: :Foo
        has_and_belongs_to_many :foos, class_name: Foo
      ```
      
      Closes #23767
      94821b4b
  29. 17 9月, 2016 1 次提交
  30. 16 8月, 2016 1 次提交
  31. 10 8月, 2016 1 次提交
  32. 07 8月, 2016 3 次提交
  33. 10 7月, 2016 1 次提交
  34. 02 7月, 2016 1 次提交