Class: JsonApiFilter::AutoJoin
- Inherits:
-
Object
- Object
- JsonApiFilter::AutoJoin
- Defined in:
- lib/json_api_filter/auto_join.rb
Instance Attribute Summary collapse
-
#association_name ⇒ Object
readonly
Returns the value of attribute association_name.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(scope, association_name) ⇒ AutoJoin
constructor
A new instance of AutoJoin.
- #predicate ⇒ Object
Constructor Details
#initialize(scope, association_name) ⇒ AutoJoin
Returns a new instance of AutoJoin.
8 9 10 11 |
# File 'lib/json_api_filter/auto_join.rb', line 8 def initialize(scope, association_name) @association_name = association_name @scope = scope end |
Instance Attribute Details
#association_name ⇒ Object (readonly)
Returns the value of attribute association_name.
4 5 6 |
# File 'lib/json_api_filter/auto_join.rb', line 4 def association_name @association_name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
4 5 6 |
# File 'lib/json_api_filter/auto_join.rb', line 4 def scope @scope end |
Instance Method Details
#predicate ⇒ Object
13 14 15 |
# File 'lib/json_api_filter/auto_join.rb', line 13 def predicate scope.joins(association_name.to_sym) end |