Class: PartialKs::FilteredTable
- Inherits:
-
Object
- Object
- PartialKs::FilteredTable
- Defined in:
- lib/partial_ks/filtered_table.rb
Instance Attribute Summary collapse
-
#custom_filter_relation ⇒ Object
readonly
Returns the value of attribute custom_filter_relation.
-
#parent_model ⇒ Object
readonly
Returns the value of attribute parent_model.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #filter_condition ⇒ Object
-
#initialize(table, parent_model, custom_filter_relation: nil) ⇒ FilteredTable
constructor
A new instance of FilteredTable.
Constructor Details
#initialize(table, parent_model, custom_filter_relation: nil) ⇒ FilteredTable
5 6 7 8 9 |
# File 'lib/partial_ks/filtered_table.rb', line 5 def initialize(table, parent_model, custom_filter_relation: nil) @table = table @parent_model = parent_model @custom_filter_relation = custom_filter_relation end |
Instance Attribute Details
#custom_filter_relation ⇒ Object (readonly)
Returns the value of attribute custom_filter_relation.
2 3 4 |
# File 'lib/partial_ks/filtered_table.rb', line 2 def custom_filter_relation @custom_filter_relation end |
#parent_model ⇒ Object (readonly)
Returns the value of attribute parent_model.
2 3 4 |
# File 'lib/partial_ks/filtered_table.rb', line 2 def parent_model @parent_model end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
2 3 4 |
# File 'lib/partial_ks/filtered_table.rb', line 2 def table @table end |
Instance Method Details
#filter_condition ⇒ Object
11 12 13 |
# File 'lib/partial_ks/filtered_table.rb', line 11 def filter_condition custom_filter_relation || parent_model end |