Module: ImportExport::ControllerMethods::ClassMethods
- Defined in:
- lib/import_export/controller_methods.rb
Instance Method Summary collapse
-
#acts_as_importable(model_class_name = nil, context = {}) ⇒ Object
any method placed here will apply to classes.
Instance Method Details
#acts_as_importable(model_class_name = nil, context = {}) ⇒ Object
any method placed here will apply to classes
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/import_export/controller_methods.rb', line 11 def acts_as_importable(model_class_name = nil, context = {}) cattr_accessor :model_class cattr_accessor :context if model_class_name self.model_class = model_class_name.to_s.classify.constantize else self.model_class = self.controller_name.singularize.classify.constantize end self.context = context send :include, InstanceMethods end |