Sha256: 0b1f2627f697d1e849270f77393aa6ba26046805b5eb209fa5117c8c3f6497d6

Contents?: true

Size: 484 Bytes

Versions: 9

Compression:

Stored size: 484 Bytes

Contents

# encoding: utf-8
module Sunrise
  module Models
    module Role
      extend ActiveSupport::Concern
      
      included do 
        belongs_to :user
        
        enumerated_attribute :role_type, :id_attribute => :role_type
        attr_accessible :role_type
        
        scope :with_type, lambda { |role_type| where(:role_type => role_type) } 
      end
      
      module ClassMethods
      end
      

      def to_sym
        role_type.code
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sunrise-cms-0.4.2 lib/sunrise/models/role.rb
sunrise-cms-0.4.1 lib/sunrise/models/role.rb
sunrise-cms-0.4.0 lib/sunrise/models/role.rb
sunrise-cms-0.3.3 lib/sunrise/models/role.rb
sunrise-cms-0.3.2 lib/sunrise/models/role.rb
sunrise-cms-0.3.1 lib/sunrise/models/role.rb
sunrise-cms-0.3.0 lib/sunrise/models/role.rb
sunrise-cms-0.3.0.rc2 lib/sunrise/models/role.rb
sunrise-cms-0.3.0.rc lib/sunrise/models/role.rb