Class: Spree::Metafields::Json

Inherits:
Spree::Metafield show all
Defined in:
app/models/spree/metafields/json.rb

Instance Method Summary collapse

Instance Method Details

#csv_valueObject



12
13
14
# File 'app/models/spree/metafields/json.rb', line 12

def csv_value
  value.to_s
end

#serialize_valueObject



6
7
8
9
10
# File 'app/models/spree/metafields/json.rb', line 6

def serialize_value
  JSON.parse(value)
rescue JSON::ParserError
  value
end