Sha256: b2e9a7cc677cf0559bb009d0527d4b47905d9db0d2ca36fb19235bf233c356e1
Contents?: true
Size: 761 Bytes
Versions: 10
Compression:
Stored size: 761 Bytes
Contents
class <%= migration_class_name %> < ActiveRecord::Migration def change enable_extension 'hstore' create_table :<%= table_name %> do |t| # t.string :title, :limit => 50, :default => "" t.text :message t.references :<%= class_name.demodulize.underscore + "able" %>, polymorphic: true t.references :user, polymorphic: true, index: true t.string :role, default: nil t.hstore :related_attributes t.timestamps end add_index :<%= table_name %>, [:<%= class_name.demodulize.underscore + "able" %>_type, :<%= class_name.demodulize.underscore + "able" %>_id], name: :index_<%= table_name %>_on_<%= class_name.demodulize.underscore %>able_type_and_<%= class_name.demodulize.underscore %>able_id end end
Version data entries
10 entries across 10 versions & 1 rubygems