Sha256: e7916764e5d7691be3cb17b4d1063870d7aa12b4f8cc12071654938b56a795ec

Contents?: true

Size: 396 Bytes

Versions: 8

Compression:

Stored size: 396 Bytes

Contents

module Roles::Base
  def valid_roles_are(*role_list)
    strategy_class.valid_roles = role_list.to_symbols
  end
end

module Roles::ActiveRecord  
  def self.included(base) 
    base.extend Roles::Base
    base.extend ClassMethods
    base.orm_name = :active_record
  end

  module ClassMethods      
    def strategy name, options=nil
      set_role_strategy name, options
    end    
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
roles_active_record-0.3.6 lib/roles_active_record/base.rb
roles_active_record-0.3.5 lib/roles_active_record/base.rb
roles_active_record-0.3.4 lib/roles_active_record/base.rb
roles_active_record-0.3.3 lib/roles_active_record/base.rb
roles_active_record-0.3.2 lib/roles_active_record/base.rb
roles_active_record-0.3.1 lib/roles_active_record/base.rb
roles_active_record-0.2.5 lib/roles_active_record/base.rb
roles_active_record-0.2.4 lib/roles_active_record/base.rb