Sha256: c27760f81ca39f8cac448d223e0c97c9f69ba8e388f4081e83a95a004d261aa4

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

class <%= permission_c %> < ActiveRecord::Base
  has_and_belongs_to_many :related_roles,
                          join_table: '<%= role_pms_tb %>', foreign_key: :<%= role_u %>_id, class_name: '<%= role_c %>', association_foreign_key: :<%= permission_u %>_id
<% unless @ii_opts[:without_group] %>
  has_and_belongs_to_many :related_role_groups,
                          join_table: '<%= group_pms_tb %>', foreign_key: :<%= group_u %>_id, class_name: '<%= group_c %>', association_foreign_key: :<%= permission_u %>_id
<% end %>
  act_as_permission
end

__END__

  string  :pred,     null: false
  string  :obj_type
  integer :obj_id
  string  :desc

  index %i[ pred obj_type obj_id ], unique: true

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i_am_i_can-3.0.0 lib/generators/i_am_i_can/templates/models/permission.erb