Class: ActiveRecord::ConnectionAdapters::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord_postgres_hstore_core/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:

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


109
110
111
112
113
# File 'lib/activerecord_postgres_hstore_core/activerecord.rb', line 109

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