app/models/spotlight/role.rb in blacklight-spotlight-2.13.0 vs app/models/spotlight/role.rb in blacklight-spotlight-3.0.0.alpha.1
- old
+ new
@@ -4,14 +4,10 @@
##
# Exhibit authorization roles
class Role < ActiveRecord::Base
ROLES = %w(admin curator).freeze
belongs_to :resource, polymorphic: true, optional: true
-
- # Ignoring for https://github.com/rubocop-hq/rubocop/issues/6764
- # rubocop:disable Rails/ReflectionClassName
belongs_to :user, class_name: Spotlight::Engine.config.user_class, autosave: true, optional: false
- # rubocop:enable Rails/ReflectionClassName
validates :role, inclusion: { in: ROLES }
validate :user_must_be_unique, if: :user
def user_key