Sha256: e2c5d92d272399daa39d194eb7813270079a5469bbd964d409345b0bb0e9949a

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

class ThinkingSphinx::ActiveRecord::Property
  attr_reader :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 facet?
    options[:facet]
  end

  def multi?
    false
  end

  def name
    (options[:as] || columns.first.__name).to_s
  end

  def type
    nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.0.pre lib/thinking_sphinx/active_record/property.rb