1. 15 1月, 2015 1 次提交
  2. 17 12月, 2014 1 次提交
    • S
      `update_column` take ruby-land input, not database-land input · dd8b5fb9
      Sean Griffin 提交于
      In the case of serialized columns, we would expect the unserialized
      value as input, not the serialized value. The original issue which made
      this distinction, #14163, introduced a bug. If you passed serialized
      input to the method, it would double serialize when it was sent to the
      database. You would see the wrong input upon reloading, or get an error
      if you had a specific type on the serialized column.
      
      To put it another way, `update_column` is a special case of
      `update_all`, which would take `['a']` and not `['a'].to_yaml`, but you
      would not pass data from `params` to it.
      
      Fixes #18037
      dd8b5fb9
  3. 17 8月, 2014 1 次提交
  4. 16 8月, 2014 1 次提交
  5. 26 6月, 2014 3 次提交
  6. 25 6月, 2014 1 次提交
    • S
      Move behavior of `read_attribute` to `AttributeSet` · a89f8a92
      Sean Griffin 提交于
      Moved `Builder` to its own file, as it started looking very weird once I
      added private methods to the `AttributeSet` class and the `Builder`
      class started to grow.
      
      Would like to refactor `fetch_value` to change to
      
      ```ruby
      self[name].value(&block)
      ```
      
      But that requires the attributes to know about their name, which they
      currently do not.
      a89f8a92
  7. 24 6月, 2014 1 次提交
    • Y
      add missing `:nodoc:` for recent refactorings. [ci skip] · b27e856d
      Yves Senn 提交于
      Adding `# :nodoc:` to the parent `class` / `module` is not going
      to ignore nested classes or modules.
      
      There is a modifier `# :nodoc: all` but sadly the containing class
      or module will continue to be in the docs.
      
      /cc @sgrif
      b27e856d
  8. 17 6月, 2014 1 次提交
  9. 14 6月, 2014 1 次提交
    • S
      Introduce an Attribute object to handle the type casting dance · 6f08db05
      Sean Griffin 提交于
      There's a lot more that can be moved to these, but this felt like a good
      place to introduce the object. Plans are:
      
      - Remove all knowledge of type casting from the columns, beyond a
        reference to the cast_type
      - Move type_cast_for_database to these objects
      - Potentially make them mutable, introduce a state machine, and have
        dirty checking handled here as well
      - Move `attribute`, `decorate_attribute`, and anything else that
        modifies types to mess with this object, not the columns hash
      - Introduce a collection object to manage these, reduce allocations, and
        not require serializing the types
      6f08db05