Sha256: e3aa9ddacb8c47e25e63039a19cd134788b9dec254cf96977d41a36c3492ac2e
Contents?: true
Size: 555 Bytes
Versions: 2
Compression:
Stored size: 555 Bytes
Contents
class ThinkingSphinx::RealTime::Property include ThinkingSphinx::Core::Property attr_reader :column, :options def initialize(column, options = {}) @options = options @column = column.respond_to?(:__name) ? column : ThinkingSphinx::ActiveRecord::Column.new(column) end def name (@options[:as] || @column.__name).to_s end def translate(object) return @column.__name unless @column.__name.is_a?(Symbol) base = @column.__stack.inject(object) { |base, node| base.try(node) } base.try(@column.__name) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
thinking-sphinx-3.1.0 | lib/thinking_sphinx/real_time/property.rb |
thinking-sphinx-3.0.6 | lib/thinking_sphinx/real_time/property.rb |