Sha256: 1c27dd11ccdf480a3ebe80ad21808684c52b840071c5305bfd94fb4df90708b1
Contents?: true
Size: 688 Bytes
Versions: 17
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true class ThinkingSphinx::ActiveRecord::Property include ThinkingSphinx::Core::Property attr_reader :model, :columns, :options def initialize(model, columns, options = {}) @model, @options = model, options @columns = Array(columns).collect { |column| column.respond_to?(:__name) ? column : ThinkingSphinx::ActiveRecord::Column.new(column) } end def rebase(associations, options) @columns = columns.inject([]) do |array, column| array + column.__replace(associations, options[:to]) end end def name (options[:as] || columns.first.__name).to_s end def source_type options[:source] end end
Version data entries
17 entries across 17 versions & 1 rubygems