Class: Importer
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Importer
- Includes:
- Paperclip::Glue
- Defined in:
- app/models/importer.rb
Constant Summary collapse
- STATUS =
%w(pending success error).freeze
Instance Method Summary collapse
Instance Method Details
#importable_columns(name_of_parser = parser) ⇒ Object
32 33 34 |
# File 'app/models/importer.rb', line 32 def importable_columns(name_of_parser = parser) source_klass.columns_names(name_of_parser.to_sym) end |
#parser_klass ⇒ Object
28 29 30 |
# File 'app/models/importer.rb', line 28 def parser_klass parser.classify.constantize end |
#source_klass ⇒ Object
23 24 25 26 |
# File 'app/models/importer.rb', line 23 def source_klass return if source.blank? source.classify.constantize end |