Method: ActiveRecord::ConnectionAdapters::TableDefinition#hstore

Defined in:
lib/activerecord-postgres-hstore/activerecord.rb

#hstore(*args) ⇒ Object

Adds hstore type for migrations. So you can add columns to a table like:

create_table :people do |t|
  ...
  t.hstore :info
  ...
end


138
139
140
141
142
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 138

def hstore(*args)
  options = args.extract_options!
  column_names = args
  column_names.each { |name| column(name, 'hstore', options) }
end