fix some policy specs failing because model Constant instead of instance passed

parent 01e33f6c
Pipeline #38208 failed with stage
in 20 minutes and 25 seconds
......@@ -19,7 +19,8 @@ class AssignmentPolicy < ApplicationPolicy
end
def reactivate?
record.reactivatable? && superadmin_or_department_manager_creation_or_volunteer_related?
record.class.name == 'Assignment' && record.reactivatable? &&
superadmin_or_department_manager_creation_or_volunteer_related?
end
# controller action policies
......
......@@ -6,7 +6,8 @@ class GroupAssignmentPolicy < ApplicationPolicy
end
def reactivate?
record.reactivatable? && superadmin_or_departments_offer_or_volunteer_related?
record.class.name == 'GroupAssignment' && record.reactivatable? &&
superadmin_or_departments_offer_or_volunteer_related?
end
alias_method :show?,
......
......@@ -36,7 +36,8 @@ class VolunteerPolicy < ApplicationPolicy
end
def reactivate?
record.resigned? && superadmin_or_departments_record_or_assignable_to_department?
record.class.name == 'Volunteer' && record.resigned? &&
superadmin_or_departments_record_or_assignable_to_department?
end
# controller action policies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment