Module: RailsAdminImport::Config
- Defined in:
- lib/rails_admin_import/config.rb,
 lib/rails_admin_import/config/legacy_model.rb
Defined Under Namespace
Classes: LegacyModel
Constant Summary collapse
- HEADER_CONVERTER =
          Default is to downcase headers and add underscores to convert into attribute names 
- lambda do |header| # check for nil/blank headers next if header.blank? header.parameterize.underscore end 
Class Attribute Summary collapse
- 
  
    
      .csv_options  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute csv_options. 
- 
  
    
      .header_converter  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute header_converter. 
- 
  
    
      .line_item_limit  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute line_item_limit. 
- 
  
    
      .logging  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute logging. 
- 
  
    
      .pass_filename  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute pass_filename. 
- 
  
    
      .rollback_on_error  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute rollback_on_error. 
- 
  
    
      .update_if_exists  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute update_if_exists. 
Class Method Summary collapse
- .model(model_name, &block) ⇒ Object
- 
  
    
      .reset  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Reset all configurations to defaults. 
Class Attribute Details
.csv_options ⇒ Object
Returns the value of attribute csv_options.
| 11 12 13 | # File 'lib/rails_admin_import/config.rb', line 11 def @csv_options end | 
.header_converter ⇒ Object
Returns the value of attribute header_converter.
| 10 11 12 | # File 'lib/rails_admin_import/config.rb', line 10 def header_converter @header_converter end | 
.line_item_limit ⇒ Object
Returns the value of attribute line_item_limit.
| 7 8 9 | # File 'lib/rails_admin_import/config.rb', line 7 def line_item_limit @line_item_limit end | 
.logging ⇒ Object
Returns the value of attribute logging.
| 6 7 8 | # File 'lib/rails_admin_import/config.rb', line 6 def logging @logging end | 
.pass_filename ⇒ Object
Returns the value of attribute pass_filename.
| 12 13 14 | # File 'lib/rails_admin_import/config.rb', line 12 def pass_filename @pass_filename end | 
.rollback_on_error ⇒ Object
Returns the value of attribute rollback_on_error.
| 8 9 10 | # File 'lib/rails_admin_import/config.rb', line 8 def rollback_on_error @rollback_on_error end | 
.update_if_exists ⇒ Object
Returns the value of attribute update_if_exists.
| 9 10 11 | # File 'lib/rails_admin_import/config.rb', line 9 def update_if_exists @update_if_exists end | 
Class Method Details
.model(model_name, &block) ⇒ Object
| 21 22 23 24 25 26 27 28 29 30 31 | # File 'lib/rails_admin_import/config.rb', line 21 def model(model_name, &block) unless @deprecation_shown warn "RailsAdminImport::Config#model is deprecated. " \ "Add a import section for your model inside the rails_admin " \ "config block. See the Readme.md for more details" @deprecation_shown = true end legacy_config = RailsAdminImport::Config::LegacyModel.new(model_name) legacy_config.instance_eval(&block) if block legacy_config end | 
.reset ⇒ Object
Reset all configurations to defaults.
| 34 35 36 37 38 39 40 41 42 | # File 'lib/rails_admin_import/config.rb', line 34 def reset @logging = false @line_item_limit = 1000 @rollback_on_error = false @update_if_exists = false @header_converter = HEADER_CONVERTER @pass_filename = false @csv_options = {} end |