PostPolicy = Struct.new(:user, :post) do

  def update?
    user.admin? or post.user == user
  end

  def destroy?
    user.admin?
  end
end

PostPolicy = Struct.new(:user, :post) do

  def update?
    return false unless user
    user.admin? or post.user == user
  end

  def destroy?
    return false unless user
    user.admin?
  end
end

Fix bug with nil user.
Fix bug with nil user.
