Sha256: 3bc535ca126b62a6b92c977a3b85de3ba54129e9506558fc04587fc97c36558c

Contents?: true

Size: 367 Bytes

Versions: 13

Compression:

Stored size: 367 Bytes

Contents

class <%= role_class %> < ActiveRecord::Base
  scope :named, lambda{|role_names| where(:name.in => role_names.flatten)}
  has_many :<%= user_class.pluralize.underscore %>, :through => :<%= user_role_class.pluralize.underscore %>
  has_many :<%= user_role_class.pluralize.underscore %>

  validates :name, :uniqueness => true
  
  extend RoleClass::ClassMethods  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
roles_active_record-0.5.1 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.5.0 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.9 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.8 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.7 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.6.4 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.6.3 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.6.2 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.6.1 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.6 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.5 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.4 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.3 lib/generators/active_record/roles/templates/many_roles/role.rb