lib/ransack/adapters/active_record/3.1/context.rb
def evaluate(search, opts = {})
          viz = Visitor.new
          relation = @object.where(viz.accept(search.base))
          if search.sorts.any?
            relation = relation.except(:order)
              .reorder(viz.accept(search.sorts))
          end
          if opts[:distinct]
            relation.select(Constants::DISTINCT + @klass.quoted_table_name +
              Constants::DOT_ASTERIX)
          else
            relation
          end
        end
# Redefine a few things for ActiveRecord 3.1.
Redefine a few things for ActiveRecord 3.1.
Redefine a few things for ActiveRecord 3 . 1 .
def evaluate(search, opts = {})
          viz = Visitor.new
          relation = @object.where(viz.accept(search.base))
          if search.sorts.any?
            relation = relation.except(:order)
              .reorder(viz.accept(search.sorts))
          end
          if opts[:distinct]
            relation.select(Constants::DISTINCT + @klass.quoted_table_name +
              Constants::DOT_ASTERIX)
          else
            relation
          end
        end
def evaluate ( search , opts = { } ) viz = Visitor . new relation = @object . where ( viz . accept ( search . base ) ) if search . sorts . any? relation = relation . except ( :order ) . reorder ( viz . accept ( search . sorts ) ) end if opts [ :distinct ] relation . select ( Constants :: DISTINCT + @klass . quoted_table_name + Constants :: DOT_ASTERIX ) else relation end end
Redefine a few things for ActiveRecord 3.1.
Redefine a few things for ActiveRecord 3 . 1 .
search
opts