Sha256: d7f2c64fde4a8766768754d6e72403e04e4c18338cddb1acd14d5b8615c2d4d9

Contents?: true

Size: 315 Bytes

Versions: 20

Compression:

Stored size: 315 Bytes

Contents

class <%= role_cname.camelize %>
  include Mongoid::Document
  
  has_and_belongs_to_many :<%= user_cname.tableize %>
  belongs_to :resource, :polymorphic => true
  
  field :name, :type => String

  index({
    :name => 1,
    :resource_type => 1,
    :resource_id => 1
  },
  { :unique => true})
  
  scopify
end

Version data entries

20 entries across 20 versions & 2 rubygems

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