Sha256: 9cda5645e21efa50734134d55dfe93d724435d83326593e200b743e9eaea8d84

Contents?: true

Size: 329 Bytes

Versions: 3

Compression:

Stored size: 329 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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
roles_active_record-0.4.2 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.1 lib/generators/active_record/roles/templates/many_roles/role.rb
roles_active_record-0.4.0 lib/generators/active_record/roles/templates/many_roles/role.rb