Class: Importable::Resource
- Defined in:
- app/models/importable/resource.rb
Instance Attribute Summary
Attributes inherited from Importer
Attributes included from MultiStep::ImportHelpers
Instance Method Summary collapse
Methods inherited from Importer
#import!, #imported_items_ready?, #invalid_items, #mapper, #mapper_class, #mapper_name_with_module, #plural_mapper_class, #singular_mapper_class
Methods included from MultiStep::ImportHelpers
#first_step?, #last_step?, #next_step, #previous_step, #steps
Instance Method Details
#resource_class ⇒ Object
12 13 14 |
# File 'app/models/importable/resource.rb', line 12 def resource_class mapper_name_with_module.camelize.constantize end |
#rows ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/models/importable/resource.rb', line 3 def rows method = import_params.delete('method') if method resource_class.get(method.to_sym, import_params) else resource_class.all(params: import_params) end end |