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


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

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


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

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

  super
end