Module: Submission::RequestOptionsBehaviour

Included in:
Order
Defined in:
app/models/submission/request_options_behaviour.rb

Defined Under Namespace

Classes: HashWrapper

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



18
19
20
21
22
23
# File 'app/models/submission/request_options_behaviour.rb', line 18

def self.included(base)
  base.class_eval do
    serialize :request_options, HashWrapper
    validate :check_request_options, if: :request_options_changed?
  end
end

Instance Method Details

#request_options=(options) ⇒ Object



25
26
27
28
29
# File 'app/models/submission/request_options_behaviour.rb', line 25

def request_options=(options)
  return super(options.nested_under_indifferent_access) if options.is_a?(Hash)

  super
end