Sha256: e6edcf56bcba3fb1cca404b8453a40d71bd9f539a75442485207dc40582fea91

Contents?: true

Size: 363 Bytes

Versions: 17

Compression:

Stored size: 363 Bytes

Contents

module EgovUtils
  class Principal < ApplicationRecord
    self.abstract_class = true

    serialize :roles, Array

    def reload(*attrs)
      @auth_source = nil
      super
    end

    def has_role?(role)
      roles.include?(role)
    end

    def auth_source
      @auth_source ||= EgovUtils::AuthSource.new(provider) if provider.present?
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
egov_utils-0.1.18 app/models/egov_utils/principal.rb
egov_utils-0.1.17 app/models/egov_utils/principal.rb
egov_utils-0.1.16 app/models/egov_utils/principal.rb
egov_utils-0.1.15 app/models/egov_utils/principal.rb
egov_utils-0.1.14 app/models/egov_utils/principal.rb
egov_utils-0.1.13 app/models/egov_utils/principal.rb
egov_utils-0.1.12 app/models/egov_utils/principal.rb
egov_utils-0.1.11 app/models/egov_utils/principal.rb
egov_utils-0.1.10 app/models/egov_utils/principal.rb
egov_utils-0.1.9 app/models/egov_utils/principal.rb
egov_utils-0.1.8 app/models/egov_utils/principal.rb
egov_utils-0.1.7 app/models/egov_utils/principal.rb
egov_utils-0.1.6 app/models/egov_utils/principal.rb
egov_utils-0.1.5 app/models/egov_utils/principal.rb
egov_utils-0.1.4 app/models/egov_utils/principal.rb
egov_utils-0.1.1 app/models/egov_utils/principal.rb
egov_utils-0.1.0 app/models/egov_utils/principal.rb