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.
72 73 74 |
# File 'lib/sequel/plugins/list.rb', line 72 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.
77 78 79 |
# File 'lib/sequel/plugins/list.rb', line 77 def scope_proc @scope_proc end |
Instance Method Details
#inherited(subclass) ⇒ Object
Copy the position_field and scope_proc to the subclass.
80 81 82 83 84 |
# File 'lib/sequel/plugins/list.rb', line 80 def inherited(subclass) super subclass.position_field = position_field subclass.scope_proc = scope_proc end |