Module: Sequel::Plugins::List::ClassMethods
- Defined in:
- lib/sequel/plugins/list.rb
Instance Attribute Summary collapse
-
#position_field ⇒ Object
The column name holding the position in the list, as a symbol.
-
#scope_proc ⇒ Object
A proc that scopes the dataset, so that there can be multiple positions in the list, but the positions are unique with the scoped dataset.
Instance Method Summary collapse
-
#inherited(subclass) ⇒ Object
Copy the
position_fieldandscope_procto the subclass.
Instance Attribute Details
#position_field ⇒ Object
The column name holding the position in the list, as a symbol.
74 75 76 |
# File 'lib/sequel/plugins/list.rb', line 74 def position_field @position_field end |
#scope_proc ⇒ Object
A proc that scopes the dataset, so that there can be multiple positions in the list, but the positions are unique with the scoped dataset. This proc should accept an instance and return a dataset representing the list.
79 80 81 |
# File 'lib/sequel/plugins/list.rb', line 79 def scope_proc @scope_proc end |
Instance Method Details
#inherited(subclass) ⇒ Object
Copy the position_field and scope_proc to the subclass.
82 83 84 85 86 |
# File 'lib/sequel/plugins/list.rb', line 82 def inherited(subclass) super subclass.position_field = position_field subclass.scope_proc = scope_proc end |