Class: ActiveScaffold::Config::Mark

Inherits:
Base show all
Defined in:
lib/active_scaffold/config/mark.rb

Instance Attribute Summary

Attributes inherited from Base

#action_group, #user

Instance Method Summary collapse

Methods inherited from Base

#crud_type, #formats, #formats=, inherited, #label

Methods included from ActiveScaffold::Configurable

#configure, #method_missing

Constructor Details

#initialize(core_config) ⇒ Mark

Returns a new instance of Mark.



5
6
7
8
9
10
11
12
13
# File 'lib/active_scaffold/config/mark.rb', line 5

def initialize(core_config)
  @core = core_config
  if core_config.actions.include?(:update)
    @core.model.send(:include, ActiveScaffold::MarkedModel) unless @core.model.ancestors.include?(ActiveScaffold::MarkedModel)
    add_mark_column
  else
    raise "Mark action requires update action in controller for model: #{core_config.model.to_s}"
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable