Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 17, 2013
  1. @lilibethdlc @pixeltrix

    Fix handling of dirty time zone aware attributes

    lilibethdlc authored pixeltrix committed
    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
    
    (cherry picked from commit bc982cb)
    
    Conflicts:
    	activerecord/CHANGELOG.md
    	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
    
    Backport of #9073
    Fixes #8898
Commits on Jan 22, 2013
  1. @pixeltrix

    Revert "Merge pull request #6986 from kennyj/fix_6975"

    pixeltrix authored
    This reverts commit 8905c1f.
    
    Closes #8460
    
    Conflicts:
    	activerecord/test/cases/dirty_test.rb
Commits on Nov 26, 2012
  1. @carlosantoniodasilva

    Merge pull request #8311 from alisdair/dirty-nullable-datetime

    carlosantoniodasilva authored
    Don't call will_change! for datetime nil->"".
    
    Setting a nil datetime attribute to a blank string should not cause the
    attribute to be dirty.
    
    Conflicts:
    	activerecord/CHANGELOG.md
    	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
Commits on Aug 21, 2012
  1. @rafaelfranca

    Merge pull request #6986 from kennyj/fix_6975

    rafaelfranca authored
    Fix #6975. Round usec when writing timestamp attribute.
    
    Conflicts:
    	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
Commits on Jun 4, 2012
  1. @kennyj
Commits on Mar 27, 2012
  1. @lest

    force datetime attributes to be changed

    lest authored
    backport ddb5d2f to 3-2-stable
Commits on Dec 3, 2011
  1. @jonleighton

    Fix #3837.

    jonleighton authored
    We also need to time zone convert time zone aware attributes when
    accessed via read_attribute, not only when via direct access.
Commits on Dec 1, 2011
  1. @jonleighton
  2. @jonleighton

    Remove the need for type_cast_attribute.

    jonleighton authored
    This is good because it reduces duplication.
  3. @jonleighton

    Don't rely on underscore-prefixed attribute methods.

    jonleighton authored
    Define singleton methods on the attributes module instead. This reduces
    method pollution on the actual model classes. It also seems to make
    something faster, I am unsure why! O_o
Commits on Apr 13, 2011
  1. @sikachu @dhh

    Remove `#among?` from Active Support

    sikachu authored dhh committed
    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?`.
Commits on Apr 11, 2011
  1. @dhh
Commits on Apr 10, 2011
  1. @sikachu @dhh

    Using Object#in? and Object#either? in various places

    sikachu authored dhh committed
    There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
Commits on Mar 23, 2011
  1. @adzap @tenderlove

    Fix before_type_cast for timezone aware attributes by caching convert…

    adzap authored tenderlove committed
    …ed value on write. Also remove read method reload arg on timezone attributes.
Commits on Feb 7, 2011
  1. @amatsuda @spastorino

    avoid nil.dup

    amatsuda authored spastorino committed
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Commits on Feb 1, 2011
  1. @amatsuda @spastorino

    Make before_type_cast available for datetime fields

    amatsuda authored spastorino committed
    [#3973 state:committed]
    
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Commits on Nov 20, 2010
  1. @joshk @josevalim

    class inheritable attributes is used no more! all internal use of cla…

    joshk authored josevalim committed
    …ss inheritable has been changed to class_attribute. class inheritable attributes has been deprecated.
    
    Signed-off-by: José Valim <jose.valim@gmail.com>
Commits on Sep 9, 2010
  1. @jeremy

    Cheaper attribute reads and respond_to?. Add underscore-prefixed meth…

    jeremy authored
    …od aliased to the attribute name so it can be overridden but still called internally.
Commits on Aug 14, 2010
  1. @spastorino

    Deletes trailing whitespaces (over text files only find * -type f -ex…

    spastorino authored
    …ec sed 's/[ \t]*$//' -i {} \;)
Commits on Aug 2, 2010
  1. @neerajdotname
Commits on Apr 9, 2010
  1. @spastorino @josevalim

    fix stack trace lines on class_eval

    spastorino authored josevalim committed
    Signed-off-by: José Valim <jose.valim@gmail.com>
Commits on Jan 21, 2010
  1. @lifo

    Revert "Refactoring attributes/types" [#3348 state:open]

    lifo authored
    This reverts commit f936a1f.
    
    Conflicts:
    
    	activerecord/lib/active_record.rb
    	activerecord/lib/active_record/base.rb
    
    Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open]
    
    This reverts commit 2831996.
    
    Reason :
    
      It's not generating attribute methods properly, making object.column 5x slower.
Commits on Oct 17, 2009
  1. @eac @josh

    Refactoring attributes/types [#3348 state:resolved]

    eac authored josh committed
    Signed-off-by: Joshua Peek <josh@joshpeek.com>
Commits on Aug 5, 2009
  1. @josh
Commits on Aug 4, 2009
  1. @paulgillard @josh

    Modified ActiveRecord::AttributeMethods to allow classes to specify a…

    paulgillard authored josh committed
    …ttribute method prefixes and/or suffixes. Previously only suffixes were allowed.
    
    Signed-off-by: Joshua Peek <josh@joshpeek.com>
Commits on Aug 3, 2009
  1. @josh
Commits on Jul 30, 2009
  1. @josh
  2. @josh

    Concernify AR AttributeMethods

    josh authored
Something went wrong with that request. Please try again.