Class: ActiveScaffold::Config::Sortable
- Inherits:
-
Base
- Object
- Base
- ActiveScaffold::Config::Sortable
- Defined in:
- lib/active_scaffold/config/sortable.rb
Constant Summary collapse
- @@plugin_directory =
- @@add_handle_column =
false
- @@options =
{}
Instance Attribute Summary collapse
-
#add_handle_column ⇒ Object
Returns the value of attribute add_handle_column.
-
#column ⇒ Object
Returns the value of attribute column.
-
#options ⇒ Object
Returns the value of attribute options.
-
#refresh_list ⇒ Object
Returns the value of attribute refresh_list.
Instance Method Summary collapse
-
#initialize(core_config) ⇒ Sortable
constructor
A new instance of Sortable.
Constructor Details
#initialize(core_config) ⇒ Sortable
Returns a new instance of Sortable.
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/active_scaffold/config/sortable.rb', line 3 def initialize(core_config) super @options = self.class..clone self.column = core_config.model.new.position_column unless (@core.model.instance_methods & [:acts_as_list_class, 'acts_as_list_class']).empty? self.column = core_config.model.new.left_column_name unless (@core.model.instance_methods & [:nested_set_scope, 'nested_set_scope']).empty? if self.column.nil? raise "ActiveScaffoldSortable: Missing sortable attribute '#{core_config.model.new.position_column}' in model '#{core_config.model.to_s}'" if @core.model.instance_methods.include? 'acts_as_list_class' raise "ActiveScaffoldSortable: Missing sortable attribute '#{core_config.model.new.left_column_name}' in model '#{core_config.model.to_s}'" if @core.model.instance_methods.include? 'nested_set_scope' end self.add_handle_column = self.class.add_handle_column self.refresh_list = self.class.refresh_list end |
Instance Attribute Details
#add_handle_column ⇒ Object
Returns the value of attribute add_handle_column.
47 48 49 |
# File 'lib/active_scaffold/config/sortable.rb', line 47 def add_handle_column @add_handle_column end |
#column ⇒ Object
Returns the value of attribute column.
30 31 32 |
# File 'lib/active_scaffold/config/sortable.rb', line 30 def column @column end |
#options ⇒ Object
Returns the value of attribute options.
44 45 46 |
# File 'lib/active_scaffold/config/sortable.rb', line 44 def @options end |
#refresh_list ⇒ Object
Returns the value of attribute refresh_list.
45 46 47 |
# File 'lib/active_scaffold/config/sortable.rb', line 45 def refresh_list @refresh_list end |