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
- #_abort? ⇒ Boolean protected
- #_skip? ⇒ Boolean protected
-
#abort? ⇒ Boolean
Returns true, if the file should abort reading.
-
#skip? ⇒ Boolean
Returns true, if the file should skip
current_row_model.
Methods included from Validators::ValidateAttributes
Instance Method Details
#_abort? ⇒ Boolean (protected)
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)
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
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
20 21 22 |
# File 'lib/csv_row_model/import/file/validations.rb', line 20 def skip? !!current_row_model.try(:skip?) end |