Show
Ignore:
Timestamp:
06/09/08 20:55:59 (7 months ago)
Author:
sandal
Message:

Fixed get_attributes_with_options method to work with rails 2.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • acts_as_reportable/lib/ruport/acts_as_reportable.rb

    r1233 r1307  
    370370      # 
    371371      def get_attributes_with_options(options = {}) 
    372         only_or_except = 
    373           if options[:only] or options[:except] 
    374             { :only => options[:only], :except => options[:except] } 
    375           end 
    376         attrs = attributes(only_or_except) 
     372        attrs = attributes 
     373        attrs.slice!(*options[:only].map(&:to_s)) if options[:only] 
     374        attrs.except!(*options[:except].map(&:to_s)) if options[:except] 
    377375        attrs = attrs.inject({}) {|h,(k,v)| 
    378376                  h["#{options[:qualify_attribute_names]}.#{k}"] = v; h