Class: ActiveRecord::ConnectionAdapters::PostgreSQLColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/padrino-hstore/activerecord.rb

Instance Method Summary collapse

Instance Method Details

#simplified_type_with_hstore(field_type) ⇒ Object

Adds the hstore type for the column.



124
125
126
# File 'lib/padrino-hstore/activerecord.rb', line 124

def simplified_type_with_hstore(field_type)
  field_type == 'hstore' ? :hstore : simplified_type_without_hstore(field_type)
end

#type_cast_code_with_hstore(var_name) ⇒ Object

Does the type casting from hstore columns using String#from_hstore or Hash#from_hstore.



119
120
121
# File 'lib/padrino-hstore/activerecord.rb', line 119

def type_cast_code_with_hstore(var_name)
  type == :hstore ? "#{var_name}.from_hstore" : type_cast_code_without_hstore(var_name)
end