# File lib/meta_search/builder.rb, line 31 def initialize(base_or_relation, opts = {}) opts = opts.dup @relation = base_or_relation.scoped @base = @relation.klass @search_key = (opts.delete(:search_key) || 'search').to_s @options = opts # Let's just hang on to other options for use in authorization blocks @join_type = opts[:join_type] || Arel::Nodes::OuterJoin @join_type = get_join_type(@join_type) @join_dependency = build_join_dependency(@relation) @search_attributes = {} @errors = ActiveModel::Errors.new(self) end