1. 28 6月, 2017 1 次提交
    • R
      Fix `ids_reader` to respect case sensitive primary key · bf3f2010
      Ryuta Kamizono 提交于
      ```ruby
        car = Car.create!(name: "Tofaş")
      
        # Before
        car.bulb_ids # => SELECT "bulbs".ID FROM "bulbs" WHERE "bulbs"."name" = $1 AND "bulbs"."car_id" = $2  [["name", "defaulty"], ["car_id", 3]]
      
        # After
        car.bulb_ids # => SELECT "bulbs"."ID" FROM "bulbs" WHERE "bulbs"."name" = $1 AND "bulbs"."car_id" = $2  [["name", "defaulty"], ["car_id", 3]]
      ```
      bf3f2010
  2. 25 6月, 2017 1 次提交
  3. 21 6月, 2017 1 次提交
  4. 16 6月, 2017 1 次提交
  5. 07 6月, 2017 1 次提交
    • R
      Avoid overwriting the methods of `AttributeMethods::PrimaryKey` · 9b8c7796
      Ryuta Kamizono 提交于
      Currently the methods of `AttributeMethods::PrimaryKey` are overwritten
      by `define_attribute_methods`. It will be broken if a table that
      customized primary key has non primary key id column.
      It should not be overwritten if a table has any primary key.
      
      Fixes #29350.
      9b8c7796
  6. 21 4月, 2017 1 次提交
  7. 13 2月, 2017 1 次提交
  8. 09 2月, 2017 1 次提交
  9. 07 2月, 2017 1 次提交
  10. 01 2月, 2017 1 次提交
  11. 17 1月, 2017 1 次提交
  12. 29 12月, 2016 1 次提交
  13. 21 12月, 2016 1 次提交
  14. 06 12月, 2016 2 次提交
  15. 31 10月, 2016 2 次提交
  16. 22 10月, 2016 1 次提交
  17. 10 10月, 2016 1 次提交
    • R
      Dump index options to pretty format · 5025fd3a
      Ryuta Kamizono 提交于
      ```ruby
        # Before
        t.index ["firm_id", "type", "rating"], name: "company_index", order: {"rating"=>:desc}, using: :btree
      
        # After
        t.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree
      ```
      5025fd3a
  18. 12 9月, 2016 1 次提交
  19. 16 8月, 2016 1 次提交
  20. 07 8月, 2016 1 次提交
  21. 10 7月, 2016 1 次提交
  22. 07 6月, 2016 1 次提交
  23. 25 4月, 2016 1 次提交
  24. 06 4月, 2016 1 次提交
    • L
      Fix undefined method `owners' for NullPreloader:Class · cb4f6875
      Ladislav Smola 提交于
      * Fix undefined method `owners' for NullPreloader:Class
      
      Fixing undefined method `owners' for
      ActiveRecord::Associations::Preloader::NullPreloader:Class
      
      * Use Ruby 1.9 hash format
      
      Use Ruby 1.9 hash format
      
      #24192
      
      [Rafael Mendonça França + Ladislav Smola]
      cb4f6875
  25. 30 3月, 2016 1 次提交
  26. 08 3月, 2016 1 次提交
  27. 20 2月, 2016 1 次提交
  28. 31 1月, 2016 1 次提交
  29. 25 1月, 2016 1 次提交
  30. 23 1月, 2016 1 次提交
    • S
      Use the database type to deserialize enum · 67c17190
      Sean Griffin 提交于
      This fixes incorrect assumptions made by e991c7b8 that we can assume the
      DB is already casting the value for us. The enum type needs additional
      information to perform casting, and needs a subtype.
      
      I've opted not to call `super` in `cast`, as we have a known set of
      types which we accept there, and the subtype likely doesn't accept them
      (symbol -> integer doesn't make sense)
      
      Close #23190
      67c17190
  31. 15 1月, 2016 1 次提交
  32. 10 1月, 2016 1 次提交
  33. 02 12月, 2015 1 次提交
    • Y
      tests, pluralize singular table name. · 0f82f661
      Yves Senn 提交于
      This solves the following error:
      
           ActiveRecord::StatementInvalid: Could not find table 'guitars'
      
      It seems that the table structure of the `Guitar` model has not been
      necessary until now. Due to the wrong table name the model was not
      correctly linked to the table.
      0f82f661
  34. 16 11月, 2015 1 次提交
    • Y
      Except keys of `build_record`'s argument from `create_scope` in initialize_attributes · 817c1825
      yui-knk 提交于
      If argument of `build_record` has key and value which is same as
      default value of database, we should also except the key from
      `create_scope` in `initialize_attributes`.
      Because at first `build_record` initialize record object with argument
      of `build_record`, then assign attributes derived from Association's scope.
      In this case `record.changed` does not include the key, which value is
      same as default value of database, so we should add the key to except list.
      
      Fix #21893.
      817c1825
  35. 27 9月, 2015 1 次提交
    • E
      Fix regression in inverse_of on through associations · ee824c88
      eileencodes 提交于
      `inverse_of` on through associations was accidently removed/caused to
      stop working in commit f8d2899d which was part of a refactoring on
      `ThroughReflection`.
      
      To fix we moved `inverse_of` and `check_validity_of_inverse!` to the
      `AbstractReflection` so it's available to the `ThroughReflection`
      without having to dup any methods. We then need to delegate `inverse_name`
      method in `ThroughReflection`. `inverse_name` can't be moved to
      `AbstractReflection` without moving methods that set the instance
      variable `@automatic_inverse_of`.
      
      This adds a test that ensures that `inverse_of` on a `ThroughReflection`
      returns the correct class name, and the correct record for the inverse
      relationship.
      
      Fixes #21692
      ee824c88
  36. 24 9月, 2015 1 次提交
  37. 23 9月, 2015 2 次提交
    • S
      0 precision is not the same as no precision · 2c7d0d42
      Sean Griffin 提交于
      And we are passing them as separate types in the query, which means 0
      precision is still not supported by older versions of MySQL. I also
      missed a handful of other cases where they need to be conditionally
      applied.
      2c7d0d42
    • S
      Don't attempt to specify datetime precision unless supported · f696494a
      Sean Griffin 提交于
      Specifically, versions of MySQL prior to 5.6 do not support this, which
      is what's used on Travis by default. The method `mysql_56?` appeared to
      only ever be used to conditionally apply subsecond precision, so I've
      generalized it and used it more liberally.
      
      This should fix the test failures caused by #20317
      f696494a