app/policies/reserve_policy.rb in enju_circulation-0.2.5 vs app/policies/reserve_policy.rb in enju_circulation-0.3.0.beta.1
- old
+ new
@@ -4,11 +4,11 @@
end
def show?
if user.try(:has_role?, 'Librarian')
true
- elsif user and user == record.user
+ elsif user && (user == record.user)
true
end
end
def create?
@@ -20,18 +20,18 @@
end
def update?
if user.try(:has_role?, 'Librarian')
true
- elsif user and user == record.user
+ elsif user && (user == record.user)
true
end
end
def destroy?
if user.try(:has_role?, 'Librarian')
true
- elsif user and user == record.user
+ elsif user && (user == record.user)
true
end
end
end