Method: JsonRecord::JsonField#initialize
- Defined in:
- lib/json_record/json_field.rb
#initialize(record, name, schemas) ⇒ JsonField
Returns a new instance of JsonField.
7 8 9 10 11 12 13 14 15 |
# File 'lib/json_record/json_field.rb', line 7 def initialize (record, name, schemas) @record = record @name = name.to_s @schemas = schemas @attributes = nil json_column = record.class.columns_hash[@name] raise ArgumentError.new("column #{name} does not exist in #{table_name}") unless json_column @compressed = json_column.type == :binary end |