class ThinkingSphinx::ActiveRecord::SQLBuilder::Query

Attributes

report[RW]
scope[RW]

Public Class Methods

new(report) click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 4
def initialize(report)
  self.report = report
  self.scope = []
end

Public Instance Methods

to_query() click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 9
def to_query
  filter_by_query_pre

  scope.compact
end

Protected Instance Methods

filter_by_query_pre() click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 19
def filter_by_query_pre
  scope_by_time_zone
  scope_by_session
  scope_by_utf8
end
method_missing(*args, &block) click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 41
def method_missing(*args, &block)
  report.send *args, &block
end
scope_by_session() click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 25
def scope_by_session
  return unless max_len = source.options[:group_concat_max_len]

  self.scope << "SET SESSION group_concat_max_len = #{max_len}"
end
scope_by_time_zone() click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 31
def scope_by_time_zone
  return if config.settings['skip_time_zone']

  self.scope += time_zone_query_pre
end
scope_by_utf8() click to toggle source
# File lib/thinking_sphinx/active_record/sql_builder/query.rb, line 37
def scope_by_utf8
  self.scope += utf8_query_pre if source.options[:utf8?]
end