Sha256: 72555d27cc81fc8f6d0abc97f67f01102c247df133e196787366e492f41da6eb

Contents?: true

Size: 445 Bytes

Versions: 7

Compression:

Stored size: 445 Bytes

Contents

class ActiveRecord::Relation
  def to_comma(style = :default)
    iterator_method =
      if arel.ast.limit || !arel.ast.orders.empty?
        Rails.logger.warn "#to_comma is being used on a relation with limit or order clauses. Falling back to iterating with :each. This can cause performance issues." if defined?(Rails)
        :each
      else
        :find_each
      end
    Comma::Generator.new(self, style).run(iterator_method)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
comma-4.2.0 lib/comma/relation.rb
comma-4.1.0 lib/comma/relation.rb
comma-4.0.1 lib/comma/relation.rb
comma-4.0.0 lib/comma/relation.rb
comma-3.2.4 lib/comma/relation.rb
comma-3.2.3 lib/comma/relation.rb
comma-3.2.2 lib/comma/relation.rb