Class: ActiveRecord::ConnectionAdapters::Table
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::Table
- Defined in:
- lib/ardb/pg_json.rb
Instance Method Summary collapse
-
#json(*args) ⇒ Object
Adds json type for migrations.
- #jsonb(*args) ⇒ Object
Instance Method Details
#json(*args) ⇒ Object
Adds json type for migrations. So you can add columns to a table like:
change_table :people do |t|
...
t.json :info
...
end
74 75 76 77 78 |
# File 'lib/ardb/pg_json.rb', line 74 def json(*args) = args. column_names = args column_names.each { |name| column(name, 'json', ) } end |
#jsonb(*args) ⇒ Object
80 81 82 83 84 |
# File 'lib/ardb/pg_json.rb', line 80 def jsonb(*args) = args. column_names = args column_names.each { |name| column(name, 'jsonb', ) } end |