creddit/app/policies/subcreddit_policy.rb

19 lines
223 B
Ruby
Raw Normal View History

2015-12-14 13:28:39 -05:00
# policies/subcreddit_policy.rb
class SubcredditPolicy < ApplicationPolicy
def index?
true
end
def show?
true
end
def create?
user.registered?
end
def update?
record.owner == user
end
end