Class: Unidom::Accession::PostFulfillment

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Common::Concerns::ModelExtension
Defined in:
app/models/unidom/accession/post_fulfillment.rb

Overview

Post Fulfillment 是岗位履行。

Class Method Summary collapse

Class Method Details

.fulfill!(fulfilled: nil, fulfiller: nil, opened_at: Time.now) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'app/models/unidom/accession/post_fulfillment.rb', line 15

def self.fulfill!(fulfilled: nil, fulfiller: nil, opened_at: Time.now)
  raise ArgumentError.new('Argument fulfilled is required.') if fulfilled.blank?
  raise ArgumentError.new('Argument fulfiller is required.') if fulfiller.blank?
  raise ArgumentError.new('Argument opened_at is required.') if opened_at.blank?
  self.create! fulfiller: fulfiller, fulfilled: fulfilled, opened_at: opened_at
end