Class: CanCan::ModelAdapters::Strategies::Base
- Inherits:
-
Object
- Object
- CanCan::ModelAdapters::Strategies::Base
- Defined in:
- lib/cancan/model_adapters/strategies/base.rb
Direct Known Subclasses
JoinedAliasEachRuleAsExistsSubquery, JoinedAliasExistsSubquery, LeftJoin, Subquery
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
-
#where_conditions ⇒ Object
readonly
Returns the value of attribute where_conditions.
Instance Method Summary collapse
- #aliased_table_name ⇒ Object
-
#initialize(adapter:, relation:, where_conditions:) ⇒ Base
constructor
A new instance of Base.
- #quoted_aliased_table_name ⇒ Object
- #quoted_table_name ⇒ Object
Constructor Details
#initialize(adapter:, relation:, where_conditions:) ⇒ Base
Returns a new instance of Base.
20 21 22 23 24 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 20 def initialize(adapter:, relation:, where_conditions:) @adapter = adapter @relation = relation @where_conditions = where_conditions end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 5 def adapter @adapter end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
5 6 7 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 5 def relation @relation end |
#where_conditions ⇒ Object (readonly)
Returns the value of attribute where_conditions.
5 6 7 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 5 def where_conditions @where_conditions end |
Instance Method Details
#aliased_table_name ⇒ Object
26 27 28 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 26 def aliased_table_name @aliased_table_name ||= "#{model_class.table_name}_alias" end |
#quoted_aliased_table_name ⇒ Object
30 31 32 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 30 def quoted_aliased_table_name @quoted_aliased_table_name ||= quote_table_name(aliased_table_name) end |
#quoted_table_name ⇒ Object
34 35 36 |
# File 'lib/cancan/model_adapters/strategies/base.rb', line 34 def quoted_table_name @quoted_table_name ||= quote_table_name(model_class.table_name) end |