Changeset 385

Show
Ignore:
Timestamp:
12/22/06 00:00:43 (2 years ago)
Author:
sandal
Message:

fix for #112

Files:

Legend:

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

    r378 r385  
    140140      options[:binding] ||= binding 
    141141      q = options[:query_obj] || Query.new(sql, options) 
    142       if options[:yield_type].eql?(:by_row) 
     142      if block_given? 
    143143        q.each { |r| yield(r) } 
    144144      elsif options[:as] 
    145145        q.result.as(options[:as]) 
    146146      else 
    147         block_given? ? yield(q.result) : q.result 
     147        q.result 
    148148      end 
    149149    end