Sha256: 36c1435db39031c0edb539f8e52f75d5956d29ff7ef8785ad994eccda5c90b07

Contents?: true

Size: 382 Bytes

Versions: 18

Compression:

Stored size: 382 Bytes

Contents

class <%= role_cname.camelize %> < ActiveRecord::Base
<% if need_table_prefix?(role_cname) %>
  def self.table_name_prefix
    <%= table_prefix(role_cname) %>_
  end
<% end %>
  has_and_belongs_to_many :<%= user_cname.tableize %>, :join_table => :<%= "#{table_name(user_cname, true)}_#{table_name(role_cname, true)}" %>
  belongs_to :resource, :polymorphic => true
  
  scopify
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rolify-6.0.1 lib/generators/rolify/templates/role-active_record.rb
rolify-6.0.0 lib/generators/rolify/templates/role-active_record.rb
rolify-5.3.0 lib/generators/rolify/templates/role-active_record.rb
rolify-5.2.0 lib/generators/rolify/templates/role-active_record.rb
rolify-5.1.0 lib/generators/rolify/templates/role-active_record.rb
rolify-5.0.0 lib/generators/rolify/templates/role-active_record.rb
rolify-4.1.1 lib/generators/rolify/templates/role-active_record.rb
rolify-4.1.0 lib/generators/rolify/templates/role-active_record.rb
rolify-4.0.0 lib/generators/rolify/templates/role-active_record.rb
rolify-3.5.2 lib/generators/rolify/templates/role-active_record.rb
rolify-3.5.1 lib/generators/rolify/templates/role-active_record.rb
rolify-3.5.0 lib/generators/rolify/templates/role-active_record.rb
rolify-3.4.1 lib/generators/rolify/templates/role-active_record.rb
rolify-3.4.0 lib/generators/rolify/templates/role-active_record.rb
rolify-3.3.0 lib/generators/rolify/templates/role-active_record.rb
third-prestige-rolify-3.3.0.rc5 lib/generators/rolify/templates/role-active_record.rb
rolify-3.3.0.rc4 lib/generators/rolify/templates/role-active_record.rb
rolify-3.3.0.rc3 lib/generators/rolify/templates/role-active_record.rb