1. 21 5月, 2016 3 次提交
  2. 10 5月, 2016 1 次提交
  3. 07 5月, 2016 1 次提交
  4. 03 5月, 2016 1 次提交
  5. 28 4月, 2016 1 次提交
  6. 25 4月, 2016 1 次提交
  7. 21 4月, 2016 1 次提交
  8. 20 4月, 2016 1 次提交
  9. 18 4月, 2016 2 次提交
  10. 16 4月, 2016 1 次提交
  11. 15 4月, 2016 1 次提交
  12. 14 4月, 2016 1 次提交
    • S
      Properly serialize all JSON primitives in the AR JSON type · efaa6e4f
      Sean Griffin 提交于
      Previously we were assuming that the only valid types for encoding were
      arrays and hashes. However, any JSON primitive is an accepted value by
      both PG and MySQL.
      
      This does involve a minor breaking change in the handling of `default`
      in the schema dumper. This is easily worked around, as passing a
      hash/array literal would have worked fine in previous versions of Rails.
      However, because of this, I will not be backporting this to 4.2 or
      earlier.
      
      Fixes #24234
      efaa6e4f
  13. 09 4月, 2016 1 次提交
    • J
      Support microsecond datetime precision on MariaDB 5.3+. · 2224d06c
      Jeremy Daer 提交于
      We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has
      supported it since 5.3.0, but even 10.x versions return a compatible
      version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5,
      before MySQL supported microsecond precision.
      
      Specialize our version check to account for MariaDB to fix.
      2224d06c
  14. 08 4月, 2016 1 次提交
  15. 30 3月, 2016 1 次提交
  16. 29 3月, 2016 2 次提交
  17. 27 3月, 2016 1 次提交
  18. 25 3月, 2016 1 次提交
    • S
      Memoize user provided defaults before type casting · ba06dab5
      Sean Griffin 提交于
      When a proc is given as a default value, the form builder ends up
      displaying `Proc#to_s` when the default is used. That's because we
      didn't handle the proc until type casting. This issue technically can
      occur any time that a proc is the value before type casting, but in
      reality the only place that will occur is when a proc default is
      provided through the attributes API, so the best place to handle this
      edge case is there.
      
      I've opted to memoize instead of just moving the `Proc#call` up, as this
      made me realize that it could potentially interact very poorly with
      dirty checking.
      
      The code here is a little redundant, but I don't want to rely on how
      `value_before_type_cast` is implemented in the super class, even if it's
      just an `attr_reader`.
      
      Fixes #24249
      
      Close #24306
      ba06dab5
  19. 22 3月, 2016 1 次提交
  20. 08 3月, 2016 4 次提交
  21. 03 3月, 2016 1 次提交
  22. 02 3月, 2016 1 次提交
  23. 25 2月, 2016 2 次提交
    • E
      Ensure suppressor runs before validations · 73f8c166
      eileencodes 提交于
      I ran into an issue where validations on a suppressed record were
      causing validation errors to be thrown on a record that was never going
      to be saved.
      
      There isn't a reason to run the validations on a record that doesn't
      matter.
      
      This change moves the suppressor up the chain to be run on the `save` or
      `save!` in the validations rather than in persistence. The issue with
      running it when we hit persistence is that the validations are run
      first, then we hit persistance, and then we hit the suppressor. The
      suppressor comes first.
      
      The change to the test was required since I added the
      `validates_presence_of` validations. Adding this alone was enough to
      demonstrate the issue. I added a new test to demonstrate the new
      behavior is explict.
      73f8c166
    • E
      Preparing for 5.0.0.beta3 release · dbfa8fdf
      eileencodes 提交于
      Adds changelog headers for beta3 release
      dbfa8fdf
  24. 24 2月, 2016 1 次提交
  25. 23 2月, 2016 1 次提交
    • J
      Fix bug in JSON deserialization when column default is an empty string · 894facb1
      Johannes Opper 提交于
      When `ActiveRecord::Coders::JSON` serialization is used and the default of the column returns `''` it raises the following error:
      
      ```
      JSON::ParserError: A JSON text must at least contain two octets!
      ```
      
      If MySQL is running in non-strict mode, it returns an empty string as column default for a text column:
      
      ```ruby
      def extract_default
        if blob_or_text_column?
          @Default = null || strict ? nil : ''
        end
      end
      ```
      
      Since `''` is invalid JSON, there shouldn't be an attempt to parse it, it should be treated like nil.
      ActiveRecord::Coders::JSON should behave consistently for all possible non-user-set column default values.
      894facb1
  26. 18 2月, 2016 3 次提交
  27. 17 2月, 2016 1 次提交
    • P
      Fixed `where` for polymorphic associations when passed an array containing different types. · 359adaed
      Philippe Huibonhoa 提交于
      When passing in an array of different types of objects to `where`, it would only take into account the class of the first object in the array.
      
          PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
      	# => SELECT "price_estimates".* FROM "price_estimates"
               WHERE ("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" IN (1, 2))
      
      This is fixed to properly look for any records matching both type and id:
      
          PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
          # => SELECT "price_estimates".* FROM "price_estimates"
               WHERE (("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" = 1)
               OR ("price_estimates"."estimate_of_type" = 'Car' AND "price_estimates"."estimate_of_id" = 2))
      359adaed
  28. 16 2月, 2016 2 次提交
    • V
      Add missing CHANGELOG for regression fix in #18155 which fixes #13387 · 8d3912ac
      Vipul A M 提交于
      [ci skip]
      8d3912ac
    • G
      Let t.foreign_key use the same `to_table` twice · aedde2a3
      George Millo 提交于
      Previously if you used `t.foreign_key` twice within the same
      `create_table` block using the same `to_table`, all statements except
      the final one would fail silently. For example, the following code:
      
          def change
            create_table :flights do |t|
              t.integer :from_id, index: true, null: false
              t.integer :to_id,   index: true, null: false
      
              t.foreign_key :airports, column: :from_id
              t.foreign_key :airports, column: :to_id
            end
          end
      
      Would only create one foreign key, on the column `from_id`.
      
      This commit allows multiple foreign keys to the same table to be created
      within one `create_table` block.
      aedde2a3
  29. 13 2月, 2016 1 次提交