lib/beso/job.rb in beso-0.3.1 vs lib/beso/job.rb in beso-0.3.2

- old
+ new

@@ -29,10 +29,12 @@ raise MissingIdentityError if @identity.nil? raise MissingTimestampError if @timestamp.nil? @since ||= options.delete( :since ) || first_timestamp - relation = model_class.instance_exec( &@scope ).where( "#{@timestamp} >= ?", @since ) + condition = "#{@table}.#{@timestamp} >= ?" + + relation = model_class.instance_exec( &@scope ).where( condition, @since ) return nil if relation.empty? Beso::CSV.generate( @extra.merge( options ) ) do |csv| csv << ( required_headers + custom_headers )