1. 07 6月, 2014 1 次提交
  2. 31 5月, 2014 1 次提交
    • S
      Rename attribute related instance variables to better express intent · eb6cee9c
      Sean Griffin 提交于
      `@attributes` was actually used for `_before_type_cast` and friends,
      while `@attributes_cache` is the type cast version (and caching is the
      wrong word there, but I'm working on removing the conditionals around
      that). I opted for `@raw_attributes`, because `_before_type_cast` is
      also semantically misleading. The values in said hash are in the state
      given by the form builder or database, so raw seemed to be a good word.
      eb6cee9c
  3. 26 5月, 2014 1 次提交
  4. 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
  5. 27 8月, 2013 1 次提交
  6. 27 1月, 2013 2 次提交
    • A
      Simplify type casting code for timezone aware attributes · 41ff6a10
      Andrew White 提交于
      With the addition of String#in_time_zone and Date#in_time_zone
      we can simplify the type casting code by checking if the value
      has an `in_time_zone` method.
      41ff6a10
    • L
      Fix handling of dirty time zone aware attributes · bc982cbc
      Lilibeth De La Cruz 提交于
      Previously, when `time_zone_aware_attributes` were enabled, after
      changing a datetime or timestamp attribute and then changing it back
      to the original value, `changed_attributes` still tracked the
      attribute as changed. This caused `[attribute]_changed?` and
      `changed?` methods to return true incorrectly.
      
      Example:
      
          in_time_zone 'Paris' do
            order = Order.new
            original_time = Time.local(2012, 10, 10)
            order.shipped_at = original_time
            order.save
            order.changed? # => false
      
            # changing value
            order.shipped_at = Time.local(2013, 1, 1)
            order.changed? # => true
      
            # reverting to original value
            order.shipped_at = original_time
            order.changed? # => false, used to return true
          end
      bc982cbc
  7. 22 1月, 2013 1 次提交
  8. 25 11月, 2012 1 次提交
  9. 17 11月, 2012 1 次提交
  10. 26 10月, 2012 1 次提交
    • J
      Remove ActiveRecord::Model · 9e4c41c9
      Jon Leighton 提交于
      In the end I think the pain of implementing this seamlessly was not
      worth the gain provided.
      
      The intention was that it would allow plain ruby objects that might not
      live in your main application to be subclassed and have persistence
      mixed in. But I've decided that the benefit of doing that is not worth
      the amount of complexity that the implementation introduced.
      9e4c41c9
  11. 21 10月, 2012 1 次提交
  12. 20 10月, 2012 1 次提交
    • J
      Get rid of the ActiveRecord::Model::DeprecationProxy thing. · 83846838
      Jon Leighton 提交于
      I think it's going to be too much pain to try to transition the
      :active_record load hook from executing against Base to executing
      against Model.
      
      For example, after Model is included in Base, and modules included in
      Model will no longer get added to the ancestors of Base.
      
      So plugins which wish to be compatible with both Model and Base should
      use the :active_record_model load hook which executes *before* Base gets
      loaded.
      
      In general, ActiveRecord::Model is an advanced feature at the moment and
      probably most people will continue to inherit from ActiveRecord::Base
      for the time being.
      83846838
  13. 12 10月, 2012 1 次提交
    • J
      Revert "Key the attributes hash with symbols" · 9e5f7cc6
      Jon Leighton 提交于
      This reverts commit 86c3dfbd.
      
      Conflicts:
      	activerecord/lib/active_record/attribute_methods/read.rb
      
      Reason: whilst this increased performance, it also presents a DoS risk
      via memory exhaustion if users were allowing user input to dictate the
      arguments of read/write_attribute. I will investigate alternative ways
      to cut down on string allocations here.
      9e5f7cc6
  14. 27 9月, 2012 1 次提交
  15. 31 8月, 2012 1 次提交
    • J
      Key the attributes hash with symbols · 86c3dfbd
      Jon Leighton 提交于
      This is a performance/GC optimisation.
      
      In theory, this could be optimised by the implementation (last time I
      checked, this would have no effect on JRuby). But in practise, this make
      attribute access faster.
      86c3dfbd
  16. 21 8月, 2012 1 次提交
  17. 03 8月, 2012 2 次提交
  18. 16 6月, 2012 1 次提交
  19. 04 6月, 2012 1 次提交
  20. 28 2月, 2012 1 次提交
  21. 10 2月, 2012 1 次提交
  22. 08 2月, 2012 3 次提交
  23. 29 12月, 2011 1 次提交
    • J
      Support configuration on ActiveRecord::Model. · 93c1f11c
      Jon Leighton 提交于
      The problem: We need to be able to specify configuration in a way that
      can be inherited to models that include ActiveRecord::Model. So it is
      no longer sufficient to put 'top level' config on ActiveRecord::Base,
      but we do want configuration specified on ActiveRecord::Base and
      descendants to continue to work.
      
      So we need something like class_attribute that can be defined on a
      module but that is inherited when ActiveRecord::Model is included.
      
      The solution: added ActiveModel::Configuration module which provides a
      config_attribute macro. It's a bit specific hence I am not putting this
      in Active Support or making it a 'public API' at present.
      93c1f11c
  24. 24 12月, 2011 1 次提交
  25. 04 12月, 2011 1 次提交
    • J
      Fix #3837. · 9c172b29
      Jon Leighton 提交于
      We also need to time zone convert time zone aware attributes when
      accessed via read_attribute, not only when via direct access.
      9c172b29
  26. 02 12月, 2011 3 次提交
  27. 13 4月, 2011 1 次提交
    • P
      Remove `#among?` from Active Support · 733bfa63
      Prem Sichanugrist 提交于
      After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.
      
      It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
      733bfa63
  28. 12 4月, 2011 1 次提交
  29. 11 4月, 2011 1 次提交
  30. 24 3月, 2011 1 次提交
  31. 07 2月, 2011 1 次提交
  32. 01 2月, 2011 1 次提交
  33. 21 11月, 2010 1 次提交
  34. 10 9月, 2010 1 次提交