Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Json

Inherits:
Type
  • Object
show all
Defined in:
lib/arjdbc/postgresql/base/oid.rb

Instance Method Summary collapse

Methods inherited from Type

#infinity, #simplified_type

Instance Method Details

#accessorObject



341
342
343
# File 'lib/arjdbc/postgresql/base/oid.rb', line 341

def accessor
  ActiveRecord::Store::StringKeyedHashAccessor
end

#typeObject



329
# File 'lib/arjdbc/postgresql/base/oid.rb', line 329

def type; :json end

#type_cast(value) ⇒ Object



335
336
337
338
339
# File 'lib/arjdbc/postgresql/base/oid.rb', line 335

def type_cast(value)
  return if value.nil?

  ConnectionAdapters::PostgreSQLColumn.string_to_json value
end

#type_cast_for_write(value) ⇒ Object



331
332
333
# File 'lib/arjdbc/postgresql/base/oid.rb', line 331

def type_cast_for_write(value)
  ConnectionAdapters::PostgreSQLColumn.json_to_string value
end