Class: ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeFinder
- Inherits:
-
Object
- Object
- ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeFinder
- Defined in:
- lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb
Instance Method Summary collapse
- #attribute ⇒ Object
-
#initialize(association) ⇒ AttributeFinder
constructor
A new instance of AttributeFinder.
Constructor Details
#initialize(association) ⇒ AttributeFinder
Returns a new instance of AttributeFinder.
4 5 6 |
# File 'lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb', line 4 def initialize(association) @association = association end |
Instance Method Details
#attribute ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb', line 8 def attribute attributes.detect { |attribute| ThinkingSphinx::ActiveRecord::AssociationProxy::AttributeMatcher.new( attribute, foreign_key ).matches? } or raise "Missing Attribute for Foreign Key #{foreign_key}" end |