Changeset 1217

Show
Ignore:
Timestamp:
11/25/07 15:36:20 (1 year ago)
Author:
sandal
Message:

Fix AAR

Files:

Legend:

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

    r1207 r1217  
    295295        data_records = [get_attributes_with_options(options)] 
    296296        Array(options[:methods]).each do |method| 
    297           data_records.first[method.to_s] = send(method) 
     297          if options[:qualify_attribute_names] 
     298            m = "#{options[:qualify_attribute_names]}.#{method}" 
     299          else 
     300            m = "#{method}" 
     301          end 
     302          data_records.first[m] = send(method) 
    298303        end 
    299304         
  • acts_as_reportable/test/acts_as_reportable_test.rb

    r1207 r1217  
    172172    def test_include_has_options 
    173173      actual = Team.report_table(:all, :only => 'name', 
    174         :include => { :players => { :only => 'name' } }) 
    175       expected = [["Testers", "Player 1"], 
    176         ["Testers", "Player 2"], 
    177         ["Others", nil]].to_table(%w[name players.name]) 
     174        :include => { :players => { :only => 'name', :methods => :stats } }) 
     175      expected = [["Testers", "Player 1", "Player 1 stats"], 
     176        ["Testers", "Player 2", "Player 2 stats"], 
     177        ["Others", nil, nil]].to_table(%w[name players.name players.stats]) 
    178178      assert_equal expected, actual 
    179179    end