Class: Effective::ReportScope
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::ReportScope
- Defined in:
- app/models/effective/report_scope.rb
Instance Method Summary collapse
Instance Method Details
#apply_scope(collection) ⇒ Object
67 68 69 |
# File 'app/models/effective/report_scope.rb', line 67 def apply_scope(collection) value.nil? ? collection.send(name) : collection.send(name, value) end |
#operation_label ⇒ Object
63 64 65 |
# File 'app/models/effective/report_scope.rb', line 63 def operation_label return '=' if advanced? end |
#to_s ⇒ Object
55 56 57 |
# File 'app/models/effective/report_scope.rb', line 55 def to_s [name, operation_label, value].compact.join(' ').presence || 'report scope' end |
#value ⇒ Object
59 60 61 |
# File 'app/models/effective/report_scope.rb', line 59 def value value_date || value_decimal || value_integer || value_price || value_string.presence || value_boolean end |