1. 01 12月, 2014 1 次提交
  2. 25 11月, 2014 1 次提交
  3. 11 11月, 2014 1 次提交
  4. 10 11月, 2014 1 次提交
    • S
      Revert the behavior of booleans in string columns to that of 4.1 · 52c3a16f
      Sean Griffin 提交于
      Why are people assigning booleans to string columns? >_>
      
      We unintentionally changed the behavior on Sqlite3 and PostgreSQL.
      Boolean values should cast to the database's representation of true and
      false. This is 't' and 'f' by default, and "1" and "0" on Mysql. The
      implementation to make the connection adapter specific behavior is hacky
      at best, and should be re-visted once we decide how we actually want to
      separate the concerns related to things that should change based on the
      database adapter.
      
      That said, this isn't something I'd expect to change based on my
      database adapter. We're storing a string, so the way the database
      represents a boolean should be irrelevant. It also seems strange for us
      to give booleans special behavior at all in string columns. Why is
      `to_s` not sufficient? It's inconsistent and confusing. Perhaps we
      should consider deprecating in the future.
      
      Fixes #17571
      52c3a16f
  5. 01 11月, 2014 1 次提交
  6. 30 10月, 2014 1 次提交
  7. 29 10月, 2014 3 次提交
  8. 23 9月, 2014 1 次提交
    • A
      add a truncate method to the connection · 9a4e183f
      Aaron Patterson 提交于
      it doesn't work on SQLite3 since it doesn't support truncate, but that's
      OK.  If you call truncate on the connection, you're now bound to that
      database (same as if you use hstore or any other db specific feature).
      9a4e183f
  9. 11 9月, 2014 2 次提交
  10. 09 9月, 2014 1 次提交
  11. 05 9月, 2014 1 次提交
  12. 02 9月, 2014 1 次提交
  13. 31 8月, 2014 1 次提交
    • J
      MySQL: set connection collation along with the charset · d5ad2037
      Jeremy Kemper 提交于
      Sets the connection collation to the database collation configured
      in database.yml. Otherwise, `SET NAMES utf8mb4` will use the default
      collation for that charset (utf8mb4_general_ci) when you may have chosen
      a different collation, like utf8mb4_unicode_ci.
      
      This only applies to literal string comparisons, not column values, so
      it is unlikely to affect you.
      d5ad2037
  14. 13 8月, 2014 1 次提交
    • S
      Change the default `null` value for timestamps · ea3ba345
      Sean Griffin 提交于
      As per discussion, this changes the model generators to specify
      `null: false` for timestamp columns. A warning is now emitted if
      `timestamps` is called without a `null` option specified, so we can
      safely change the behavior when no option is specified in Rails 5.
      ea3ba345
  15. 15 7月, 2014 2 次提交
  16. 06 7月, 2014 1 次提交
    • M
      If our connection is explicitly non-strict, tell MySQL · a4c26249
      Matthew Draper 提交于
      We default to making the connection strict, but have historically relied
      on the MySQL default when we want it to be non-strict. On some (recent?)
      versions of MySQL, new connections default to being strict, so if we've
      been told 'strict:false', we're obliged to pass that on.
      
      This fixes a test failure that we've seen turn up on relatively-new
      development machines, so we do already have a test covering it.
      a4c26249
  17. 27 6月, 2014 7 次提交
  18. 26 6月, 2014 1 次提交
  19. 18 6月, 2014 1 次提交
    • S
      Don't type cast the default on the column · 4d3e88fc
      Sean Griffin 提交于
      If we want to have type decorators mess with the attribute, but not the
      column, we need to stop type casting on the column. Where possible, we
      changed the tests to test the value of `column_defaults`, which is
      public API. `Column#default` is not.
      4d3e88fc
  20. 14 6月, 2014 1 次提交
  21. 07 6月, 2014 1 次提交
  22. 03 6月, 2014 1 次提交
  23. 29 5月, 2014 1 次提交
  24. 27 5月, 2014 2 次提交
  25. 23 5月, 2014 1 次提交
    • S
      Push limit to type objects · 11199051
      Sean Griffin 提交于
      Columns and injected types no longer have any conditionals based on the
      format of SQL type strings! Hooray!
      11199051
  26. 21 5月, 2014 1 次提交
    • S
      Replace `type_cast` case statement with delegation · e781aa31
      Sean Griffin 提交于
      All subclasses of column were now delegating `type_cast` to their
      injected type object. We can remove the overriding methods, and
      generalize it on the `Column` class itself. This also enabled us to
      remove several column classes completely, as they no longer had any
      meaningful behavior of their own.
      e781aa31
  27. 20 5月, 2014 1 次提交
    • S
      Remove :timestamp column type · d0f8c46e
      Sean Griffin 提交于
      The `:timestamp` type for columns is unused. All database adapters treat
      them as the same database type. All code in `ActiveRecord` which changes
      its behavior based on the column's type acts the same in both cases.
      However, when the type is passed to code that checks for the `:datetime`
      type, but not `:timestamp` (such as XML serialization), the result is
      unexpected behavior.
      
      Existing schema definitions will continue to work, and the `timestamp`
      type is transparently aliased to `datetime`.
      d0f8c46e
  28. 19 5月, 2014 1 次提交
    • S
      Delegate `Column#type` to the injected type object · 0b682e4b
      Sean Griffin 提交于
      The decision to wrap type registrations in a proc was made for two
      reasons.
      
      1. Some cases need to make an additional decision based on the type
        (e.g. a `Decimal` with a 0 scale)
      2. Aliased types are automatically updated if they type they point to is
        updated later. If a user or another adapter decides to change the
        object used for `decimal` columns, `numeric`, and `number` will
        automatically point to the new type, without having to track what
        types are aliased explicitly.
      
      Everything else here should be pretty straightforward. PostgreSQL ranges
      had to change slightly, since the `simplified_type` method is gone.
      0b682e4b
  29. 18 5月, 2014 1 次提交
    • S
      Add a type object to Column constructor · 4bd5dffc
      Sean Griffin 提交于
      Part of #15134. In order to perform typecasting polymorphically, we need
      to add another argument to the constructor. The order was chosen to
      match the `oid_type` on `PostgreSQLColumn`.
      4bd5dffc