1. 14 6月, 2014 7 次提交
  2. 13 6月, 2014 4 次提交
  3. 12 6月, 2014 3 次提交
  4. 11 6月, 2014 9 次提交
  5. 10 6月, 2014 12 次提交
  6. 09 6月, 2014 2 次提交
  7. 08 6月, 2014 3 次提交
    • 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
    • S
      Move conditionals about freezing closer to the definition of `freeze` · 105e0304
      Sean Griffin 提交于
      Reduces the number of places that care about the internals of how we
      store and type cast attributes. We do not need to go through the
      dup/freeze dance, as you couldn't have saved a frozen new record anyway,
      and that is the only time we would end up modifying the frozen hash.
      105e0304
    • S
      Remove dead branch when restoring ID within a transaction · 35164093
      Sean Griffin 提交于
      There is no way to have an instance of an Active Record model where
      `has_attribute?(self.class.primary_key)` returns false. The record is
      always initialized in such a way that `@raw_attributes` will have an id
      key with nil for the value.
      35164093