Sha256: ffe03e7e60f398be9a8035ee9fde18b33160b754a18b26473d1338f979246b6a

Contents?: true

Size: 375 Bytes

Versions: 19

Compression:

Stored size: 375 Bytes

Contents

class ThinkingSphinx::ActiveRecord::Attribute::Values
  def initialize(attribute)
    @attribute = attribute
  end

  def value_for(instance)
    object = column.__stack.inject(instance) { |object, name|
      object.nil? ? nil : object.send(name)
    }
    object.nil? ? nil : object.send(column.__name)
  end

  private

  def column
    @attribute.columns.first
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.1.1 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.1.0 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.6 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.5 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.4 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.3 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.2 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.1 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.0 lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.0.rc lib/thinking_sphinx/active_record/attribute/values.rb
thinking-sphinx-3.0.0.pre lib/thinking_sphinx/active_record/attribute/values.rb