Module: Searchgasm::ActiveRecord::Associations::AssociationCollection
- Defined in:
- lib/searchgasm/active_record/associations.rb
Instance Method Summary collapse
-
#build_conditions(options = {}, &block) ⇒ Object
See build_conditions under Searchgasm::ActiveRecord::Base.
-
#build_conditions!(options = {}, &block) ⇒ Object
See build_conditions! under Searchgasm::ActiveRecord::Base.
-
#build_search(options = {}, &block) ⇒ Object
See build_search under Searchgasm::ActiveRecord::Base.
-
#build_search!(options = {}, &block) ⇒ Object
See build_conditions! under Searchgasm::ActiveRecord::Base.
-
#find_with_searchgasm(*args) ⇒ Object
This is an alias method chain.
Instance Method Details
#build_conditions(options = {}, &block) ⇒ Object
See build_conditions under Searchgasm::ActiveRecord::Base. This is the same thing but for associations.
16 17 18 19 20 |
# File 'lib/searchgasm/active_record/associations.rb', line 16 def build_conditions( = {}, &block) conditions = @reflection.klass.build_conditions(, &block) conditions.scope = scope(:find)[:conditions] conditions end |
#build_conditions!(options = {}, &block) ⇒ Object
See build_conditions! under Searchgasm::ActiveRecord::Base. This is the same thing but for associations.
23 24 25 26 27 |
# File 'lib/searchgasm/active_record/associations.rb', line 23 def build_conditions!( = {}, &block) conditions = @reflection.klass.build_conditions!(, &block) conditions.scope = scope(:find)[:conditions] conditions end |
#build_search(options = {}, &block) ⇒ Object
See build_search under Searchgasm::ActiveRecord::Base. This is the same thing but for associations.
30 31 32 33 34 |
# File 'lib/searchgasm/active_record/associations.rb', line 30 def build_search( = {}, &block) conditions = @reflection.klass.build_search(, &block) conditions.scope = scope(:find)[:conditions] conditions end |
#build_search!(options = {}, &block) ⇒ Object
See build_conditions! under Searchgasm::ActiveRecord::Base. This is the same thing but for associations.
37 38 39 40 41 |
# File 'lib/searchgasm/active_record/associations.rb', line 37 def build_search!( = {}, &block) conditions = @reflection.klass.build_search!(, &block) conditions.scope = scope(:find)[:conditions] conditions end |
#find_with_searchgasm(*args) ⇒ Object
This is an alias method chain. It hook into ActiveRecord’s “find” method for associations and checks to see if Searchgasm should get involved.
9 10 11 12 13 |
# File 'lib/searchgasm/active_record/associations.rb', line 9 def find_with_searchgasm(*args) = args. args << () find_without_searchgasm(*args) end |