17 changed files with 67 additions and 67 deletions
@ -1,31 +1,31 @@
|
||||
module Forms |
||||
module BulkUploadLettingsSoftValidationsCheck |
||||
class SoftErrorsValid |
||||
class ConfirmSoftErrors |
||||
include ActiveModel::Model |
||||
include ActiveModel::Attributes |
||||
include Rails.application.routes.url_helpers |
||||
|
||||
attribute :bulk_upload |
||||
attribute :soft_errors_valid, :string |
||||
attribute :confirm_soft_errors, :string |
||||
|
||||
validates :soft_errors_valid, presence: true |
||||
validates :confirm_soft_errors, presence: true |
||||
|
||||
def options |
||||
[ |
||||
OpenStruct.new(id: "yes", name: "Yes, some of these are errors"), |
||||
OpenStruct.new(id: "no", name: "No, all the data is correct"), |
||||
OpenStruct.new(id: "yes", name: "Yes, these fields are correct"), |
||||
OpenStruct.new(id: "no", name: "No, there are errors"), |
||||
] |
||||
end |
||||
|
||||
def view_path |
||||
"bulk_upload_lettings_soft_validations_check/soft_errors_valid" |
||||
"bulk_upload_lettings_soft_validations_check/confirm_soft_errors" |
||||
end |
||||
|
||||
def next_path |
||||
case soft_errors_valid |
||||
when "yes" |
||||
page_bulk_upload_lettings_resume_path(bulk_upload, page: "fix-choice", soft_errors_only: true) |
||||
case confirm_soft_errors |
||||
when "no" |
||||
page_bulk_upload_lettings_resume_path(bulk_upload, page: "fix-choice", soft_errors_only: true) |
||||
when "yes" |
||||
page_bulk_upload_lettings_soft_validations_check_path(bulk_upload, page: "confirm") |
||||
else |
||||
raise "invalid choice" |
||||
@ -1,31 +1,31 @@
|
||||
module Forms |
||||
module BulkUploadSalesSoftValidationsCheck |
||||
class SoftErrorsValid |
||||
class ConfirmSoftErrors |
||||
include ActiveModel::Model |
||||
include ActiveModel::Attributes |
||||
include Rails.application.routes.url_helpers |
||||
|
||||
attribute :bulk_upload |
||||
attribute :soft_errors_valid, :string |
||||
attribute :confirm_soft_errors, :string |
||||
|
||||
validates :soft_errors_valid, presence: true |
||||
validates :confirm_soft_errors, presence: true |
||||
|
||||
def options |
||||
[ |
||||
OpenStruct.new(id: "yes", name: "Yes, some of these are errors"), |
||||
OpenStruct.new(id: "no", name: "No, all the data is correct"), |
||||
OpenStruct.new(id: "yes", name: "Yes, these fields are correct"), |
||||
OpenStruct.new(id: "no", name: "No, there are errors"), |
||||
] |
||||
end |
||||
|
||||
def view_path |
||||
"bulk_upload_sales_soft_validations_check/soft_errors_valid" |
||||
"bulk_upload_sales_soft_validations_check/confirm_soft_errors" |
||||
end |
||||
|
||||
def next_path |
||||
case soft_errors_valid |
||||
when "yes" |
||||
page_bulk_upload_sales_resume_path(bulk_upload, page: "fix-choice") |
||||
case confirm_soft_errors |
||||
when "no" |
||||
page_bulk_upload_sales_resume_path(bulk_upload, page: "fix-choice", soft_errors_only: true) |
||||
when "yes" |
||||
page_bulk_upload_sales_soft_validations_check_path(bulk_upload, page: "confirm") |
||||
else |
||||
raise "invalid choice" |
||||
Loading…
Reference in new issue