change privileged accounts to gold accounts, add platinum accounts, add favorite and tag query limiting based on level

This commit is contained in:
albert
2013-02-20 00:02:43 -05:00
parent 8fb20c6b3a
commit 66fc05e30b
9 changed files with 63 additions and 12 deletions

View File

@@ -10,7 +10,11 @@ class FavoritesController < ApplicationController
end
def create
Post.find(params[:post_id]).add_favorite!(CurrentUser.user)
if CurrentUser.favorite_limit.nil? || CurrentUser.favorite_count < CurrentUser.favorite_limit
Post.find(params[:post_id]).add_favorite!(CurrentUser.user)
else
@error_msg = "You can only keep up to #{CurrentUser.favorite_limit} favorites. Upgrade your account to save more."
end
end
def destroy