Class: ActiveRecord::ConnectionAdapters::PostgreSQLColumn
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::PostgreSQLColumn
- Defined in:
- lib/activerecord-postgres-hstore/activerecord.rb
Instance Method Summary collapse
- #old_simplified_type ⇒ Object
- #old_type_cast_code ⇒ Object
-
#simplified_type(field_type) ⇒ Object
Adds the hstore type for the column.
-
#type_cast_code(var_name) ⇒ Object
Does the type casting from hstore columns using String#from_hstore or Hash#from_hstore.
Instance Method Details
#old_simplified_type ⇒ Object
122 |
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 122 alias :old_simplified_type :simplified_type |
#old_type_cast_code ⇒ Object
121 |
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 121 alias :old_type_cast_code :type_cast_code |
#simplified_type(field_type) ⇒ Object
Adds the hstore type for the column.
130 131 132 |
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 130 def simplified_type(field_type) field_type =~ /^hstore$/ ? :hstore : old_simplified_type(field_type) end |
#type_cast_code(var_name) ⇒ Object
Does the type casting from hstore columns using String#from_hstore or Hash#from_hstore.
125 126 127 |
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 125 def type_cast_code(var_name) type == :hstore ? "#{var_name}.from_hstore" : old_type_cast_code(var_name) end |