Module: CsvRowModel::Import::File::Validations

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Validations, Validators::ValidateAttributes
Included in:
CsvRowModel::Import::File
Defined in:
lib/csv_row_model/import/file/validations.rb

Instance Method Summary collapse

Methods included from Validators::ValidateAttributes

validate_attributes

Instance Method Details

#_abort?Boolean (protected)

Returns:



25
26
27
28
29
# File 'lib/csv_row_model/import/file/validations.rb', line 25

def _abort?
  abort = abort?
  run_callbacks(:abort) if abort
  abort
end

#_skip?Boolean (protected)

Returns:



31
32
33
34
35
# File 'lib/csv_row_model/import/file/validations.rb', line 31

def _skip?
  skip = skip?
  run_callbacks(:skip) if skip
  skip
end

#abort?Boolean

Returns true, if the file should abort reading

Returns:

  • (Boolean)

    returns true, if the file should abort reading



15
16
17
# File 'lib/csv_row_model/import/file/validations.rb', line 15

def abort?
  !valid? || !!current_row_model.try(:abort?)
end

#skip?Boolean

Returns true, if the file should skip current_row_model

Returns:

  • (Boolean)

    returns true, if the file should skip current_row_model



20
21
22
# File 'lib/csv_row_model/import/file/validations.rb', line 20

def skip?
  !!current_row_model.try(:skip?)
end