Sha256: 10b6fe92d55796899056a253d045cc06ff12beb935a30ea46dd15671218a02f3
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require 'closure_tree' require 'configurations' require 'active_record_union' require 'monarchy/acts_as_role' require 'monarchy/acts_as_member' require 'monarchy/acts_as_hierarchy' require 'monarchy/acts_as_resource' require 'monarchy/acts_as_user' require 'monarchy/engine' module Monarchy cattr_accessor :resource_classes def self.resource_classes @resource_classes ||= [] end include Configurations configuration_defaults do |config| config.member_class_name = 'Monarchy::Member' config.role_class_name = 'Monarchy::Role' config.member_force_revoke = false end not_configured do |prop| raise NoMethodError, "Monarchy requires a #{prop} to be configured" end def self.member_class Monarchy.configuration.member_class_name.safe_constantize end def self.role_class Monarchy.configuration.role_class_name.safe_constantize end def self.user_class klass = Monarchy.configuration.user_class_name.safe_constantize klass ? klass : raise(ArgumentError, 'User class has to be initialized or exist!') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
monarchy-1.1.3 | lib/monarchy.rb |