1. 22 9月, 2015 1 次提交
  2. 23 3月, 2015 2 次提交
  3. 18 2月, 2015 2 次提交
  4. 08 2月, 2015 2 次提交
  5. 24 12月, 2014 1 次提交
  6. 14 11月, 2014 1 次提交
  7. 18 9月, 2014 1 次提交
  8. 27 8月, 2014 1 次提交
  9. 01 8月, 2014 1 次提交
  10. 14 6月, 2014 2 次提交
  11. 10 6月, 2014 3 次提交
    • S
      Keep the types of virtual columns after yaml serialization · 47f1c10c
      Sean Griffin 提交于
      On MySQL and PostgreSQL, the adapter does not type cast virtual columns
      for us.
      47f1c10c
    • S
      Rename `type_cast` to `type_cast_from_database` · d24e6407
      Sean Griffin 提交于
      In some cases there is a difference between the two, we should always
      be doing one or the other. For convenience, `type_cast` is still a
      private method on type, so new types that do not need different behavior
      don't need to implement two methods, but it has been moved to private so
      it cannot be used accidentally.
      d24e6407
    • S
      Make `_before_type_cast` actually be before type cast · c93dbfef
      Sean Griffin 提交于
      - The following is now true for all types, all the time
        - `model.attribute_before_type_cast == given_value`
        - `model.attribute == model.save_and_reload.attribute`
        - `model.attribute == model.dup.attribute`
        - `model.attribute == YAML.load(YAML.dump(model)).attribute`
      - Removes the remaining types implementing `type_cast_for_write`
      - Simplifies the implementation of time zone aware attributes
      - Brings tz aware attributes closer to being implemented as an attribute
        decorator
      - Adds additional point of control for custom types
      c93dbfef
  12. 08 6月, 2014 1 次提交
    • S
      Do not type cast twice on attribute assignment · 368cca51
      Sean Griffin 提交于
      The definition of `write_attribute` in dirty checking ultimately leads
      to the columns calling `type_cast` on the value to perform the
      comparison. However, this is a potentially expensive computation that we
      cache when it occurs in `read_attribute`. The only case that we need the
      non-type-cast form is for numeric, so we pass that through as well
      (something I'm looking to remove in the future).
      
      This also reduces the number of places that manually access various
      stages in an attribute's type casting lifecycle, which will aid in one
      of the larger refactorings that I'm working on.
      368cca51
  13. 06 6月, 2014 1 次提交
  14. 03 6月, 2014 1 次提交
  15. 02 6月, 2014 1 次提交
    • S
      Remove most code related to serialized properties · 90c8be76
      Sean Griffin 提交于
      Nearly completely implemented in terms of custom properties.
      `_before_type_cast` now stores the raw serialized string consistently,
      which removes the need to keep track of "state". The following is now
      consistently true:
      
      - `model.serialized == model.reload.serialized`
      - A model can be dumped and loaded infinitely without changing
      - A model can be saved and reloaded infinitely without changing
      90c8be76
  16. 30 5月, 2014 2 次提交