Sha256: 51fee67c797d930680c1e1303997ee226d8a7ff5a89ab6bb2d6cbae90f8486e8

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 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 %>
  acts_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.1 lib/generators/i_am_i_can/templates/models/permission.erb