Sha256: e208a29dfe46b3335422fdc2182a7909e48d96044f4fa7210cf7fca3ddb651c5

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

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

  acts_as_permission
end

__END__

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
i_am_i_can-4.3.3 lib/generators/i_am_i_can/templates/models/permission.erb
i_am_i_can-4.3.2 lib/generators/i_am_i_can/templates/models/permission.erb
i_am_i_can-4.3.1 lib/generators/i_am_i_can/templates/models/permission.erb
i_am_i_can-4.3.0 lib/generators/i_am_i_can/templates/models/permission.erb