class Unpoly::Rails::Change::Field::Array

Public Instance Methods

parse(raw) click to toggle source
# File lib/unpoly/rails/change/field.rb, line 98
def parse(raw)
  if raw.present?
    result = ActiveSupport::JSON.decode(raw)
  else
    result = []
  end

  result
end
stringify(value) click to toggle source
# File lib/unpoly/rails/change/field.rb, line 108
def stringify(value)
  ActiveSupport::JSON.encode(value)
end