Sha256: b50f6578c76c2545edd63eaecd32af6b25d16acb36147fd1f0e2b7bf2189a840

Contents?: true

Size: 747 Bytes

Versions: 2

Compression:

Stored size: 747 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 %>
  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

2 entries across 2 versions & 1 rubygems

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