Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8870

Show
Ignore:
Timestamp:
02/14/08 20:06:25 (5 months ago)
Author:
nzkoz
Message:

Optimisation for BigDecimal conversion code. Closes #11110 [adymo]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r8867 r8870  
    44 
    55* Improve associations performance by avoiding named block arguments.  #11109 [adymo] 
     6 
     7* Optimise the BigDecimal conversion code.  #11110 [adymo] 
    68 
    79* Introduce the :readonly option to all associations. Records from the association cannot be saved.  #11084 [miloops] 
  • trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

    r8627 r8870  
    145145        # convert something to a BigDecimal 
    146146        def value_to_decimal(value) 
    147           if value.is_a?(BigDecimal) 
     147          # Using .class is faster than .is_a? and 
     148          # subclasses of BigDecimal will be handled 
     149          # in the else clause 
     150          if value.class == BigDecimal 
    148151            value 
    149152          elsif value.respond_to?(:to_d)