Module: ActiveRecordOptionShim

Defined in:
lib/errgonomic/rails/active_record_optional.rb

Instance Method Summary collapse

Instance Method Details

#type_cast(value) ⇒ Object



75
76
77
78
79
80
81
82
83
84
# File 'lib/errgonomic/rails/active_record_optional.rb', line 75

def type_cast(value)
  case value
  when Errgonomic::Option::Some
    super(value.unwrap!)
  when Errgonomic::Option::None
    super(nil)
  else
    super
  end
end