Module: ErrorOperationHelper
- Extended by:
- ActiveSupport::Concern
- Included in:
- AccountCpt::Registration::RegularUser::WithFacebook, AccountCpt::Registration::RegularUser::WithFacebookV2, AccountCpt::Registration::RegularUser::WithFirebase, AccountCpt::Registration::RegularUser::WithPassword, AccountCpt::Session::StaffUser::WithGoogle
- Defined in:
- app/my_lib/error_operation_helper.rb
Overview
typed: ignore Used in Trailblazer based class
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #errors ⇒ Object
-
#merge_errors ⇒ Object
pass another ActiveModel::Errors instance in block.
Instance Method Details
#errors ⇒ Object
6 7 8 9 10 |
# File 'app/my_lib/error_operation_helper.rb', line 6 def errors return @skills[OpCons::ERRORS] if @skills[OpCons::ERRORS].is_a?(ActiveModel::Errors) @skills[OpCons::ERRORS] = ActiveModel::Errors.new(self) @skills[OpCons::ERRORS] end |
#merge_errors ⇒ Object
pass another ActiveModel::Errors instance in block
16 17 18 19 20 21 22 23 24 |
# File 'app/my_lib/error_operation_helper.rb', line 16 def merge_errors another_errors = yield if another_errors.is_a? ActiveModel::Errors another_errors.each do |attr, error| next if errors.added? attr, error errors.add attr, error end end end |