Module: ParamsReady::Query::Predicate::DelegatingPredicate
- Included in:
- CustomPredicate, FixedOperatorPredicate, NullnessPredicate, ParamsReady::Query::PolymorphPredicate, VariableOperatorPredicate
- Defined in:
- lib/params_ready/query/predicate.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #eligible_for_query?(_table, context) ⇒ Boolean
- #to_query_if_eligible(arel_table, context:) ⇒ Object
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
146 147 148 |
# File 'lib/params_ready/query/predicate.rb', line 146 def data @data end |
Class Method Details
.included(base) ⇒ Object
130 131 132 |
# File 'lib/params_ready/query/predicate.rb', line 130 def self.included(base) base.include Parameter::DelegatingParameter end |
Instance Method Details
#eligible_for_query?(_table, context) ⇒ Boolean
134 135 136 137 138 |
# File 'lib/params_ready/query/predicate.rb', line 134 def eligible_for_query?(_table, context) return false unless context.permitted? self is_definite? end |
#to_query_if_eligible(arel_table, context:) ⇒ Object
140 141 142 143 144 145 |
# File 'lib/params_ready/query/predicate.rb', line 140 def to_query_if_eligible(arel_table, context:) return unless eligible_for_query?(arel_table, context) context = context_for_predicates(context) to_query(arel_table, context: context) end |