Module: Faalis::Concerns::Assignment
- Defined in:
- app/models/faalis/concerns/assignment.rb
Overview
This concern provide the default query loading scope for model. Using this, you can make queries like key=value in http request and Model.assignment(key: value) on you model.
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
8 9 10 11 12 |
# File 'app/models/faalis/concerns/assignment.rb', line 8 def self.included(base) base.scope :assignment_query, ->(field, value) do base.where(field => value) end end |