Module: Care::AutoFinder::Findable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Finder
- Defined in:
- lib/care/auto_finder/findable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/care/auto_finder/findable.rb', line 50 def call collection = relation || self.class.relation chain_filter.each do |filter| collection = send(filter, collection) end collection.distinct end |
#initialize(options = {}) ⇒ Object
44 45 46 47 48 |
# File 'lib/care/auto_finder/findable.rb', line 44 def initialize( = {}) = .symbolize_keys @relation = [:relation] || self.class.relation || [:params][:relation] @params = [:params] || || {} end |