Sha256: 6e10ad00f2a6611fac32c3f7170a13d4156bca7781d855b98df0794eeeec98ed
Contents?: true
Size: 878 Bytes
Versions: 9
Compression:
Stored size: 878 Bytes
Contents
class ZuulRoleSubjectCreate<%= table_name.camelize %> < ActiveRecord::Migration def change create_table(:<%= table_name %>) do |t| <% attributes.each do |attribute| -%> t.<%= attribute.type %> :<%= attribute.name %> <% end -%> t.timestamps end add_index :<%= table_name %>, :<%= role_model.to_s.underscore.singularize %>_id add_index :<%= table_name %>, :<%= subject_model.to_s.underscore.singularize %>_id add_index :<%= table_name %>, :context_type add_index :<%= table_name %>, :context_id add_index :<%= table_name %>, [:<%= role_model.to_s.underscore.singularize %>_id, :<%= subject_model.to_s.underscore.singularize %>_id, :context_type, :context_id], :unique => true, :name => 'index_<%= table_name %>_on_<%= role_model.to_s.underscore.singularize %>_and_<%= subject_model.to_s.underscore.singularize %>_and_context' end end
Version data entries
9 entries across 9 versions & 1 rubygems