Class: ProtectedRecord::UseCase::ChangeFilter::Create
- Inherits:
-
Object
- Object
- ProtectedRecord::UseCase::ChangeFilter::Create
- Includes:
- PayDirt::UseCase
- Defined in:
- lib/protected_record/use_case/change_filter/create.rb
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(options) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(options) ⇒ Create
Returns a new instance of Create.
6 7 8 9 |
# File 'lib/protected_record/use_case/change_filter/create.rb', line 6 def initialize() (:protected_record, ) validate_state end |
Instance Method Details
#execute! ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/protected_record/use_case/change_filter/create.rb', line 11 def execute! if @protected_record.changes.present? revert_protected_attrs end return PayDirt::Result.new(data: { change_request_record: @protected_record }, success: true) end |