Skip to content

Commit

Permalink
Return record if an orgnanization (#1113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meri-MG authored Nov 7, 2024
1 parent a80bb41 commit f662caf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/policies/application_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ApplicationPolicy < ActionPolicy::Base
# Define shared methods useful for most policies.

def organization
return record if record.is_a?(Organization)

@organization || record.organization
end

Expand Down
6 changes: 0 additions & 6 deletions app/policies/organizations/organization_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,5 @@ class OrganizationPolicy < ApplicationPolicy
def manage?
permission?(:manage_organization)
end

private

def organization
record
end
end
end

0 comments on commit f662caf

Please sign in to comment.