Class: ActiveRecord::ConnectionAdapters::Table

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

Instance Method Summary collapse

Instance Method Details

#hstore(*args) ⇒ Object

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

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


176
177
178
179
180
# File 'lib/activerecord-postgres-hstore/activerecord.rb', line 176

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