diff --git a/app/models/favorite.rb b/app/models/favorite.rb index f6ce651bd..883873d16 100644 --- a/app/models/favorite.rb +++ b/app/models/favorite.rb @@ -29,9 +29,7 @@ class Favorite < ApplicationRecord Favorite.transaction do User.where(id: user.id).select("id").lock("FOR UPDATE").first - if user.favorite_count >= user.favorite_limit - raise Error, "You can only keep up to #{user.favorite_limit} favorites. Upgrade your account to save more." - elsif Favorite.for_user(user.id).where(:user_id => user.id, :post_id => post.id).exists? + if Favorite.for_user(user.id).where(:user_id => user.id, :post_id => post.id).exists? raise Error, "You have already favorited this post" end diff --git a/app/models/user.rb b/app/models/user.rb index b266799dd..122e4869c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -436,16 +436,6 @@ class User < ApplicationRecord end end - def favorite_limit(level) - if level >= User::Levels::PLATINUM - Float::INFINITY - elsif level == User::Levels::GOLD - 20_000 - else - 10_000 - end - end - def favorite_group_limit(level) if level >= User::Levels::BUILDER Float::INFINITY @@ -514,10 +504,6 @@ class User < ApplicationRecord User.tag_query_limit(level) end - def favorite_limit - User.favorite_limit(level) - end - def favorite_group_limit User.favorite_group_limit(level) end diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index 50c60530a..ebf97d350 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -62,7 +62,7 @@ class UserPolicy < ApplicationPolicy comment_threshold default_image_size favorite_tags blacklisted_tags time_zone per_page custom_style favorite_count statement_timeout favorite_group_limit - favorite_limit tag_query_limit max_saved_searches theme + tag_query_limit max_saved_searches theme ] end diff --git a/app/views/user_upgrades/new.html.erb b/app/views/user_upgrades/new.html.erb index 67249de7c..f72ed032a 100644 --- a/app/views/user_upgrades/new.html.erb +++ b/app/views/user_upgrades/new.html.erb @@ -70,12 +70,6 @@ 2,000 5,000 - - Favorite Limit - 10,000 - 20,000 - Unlimited - Favorite Groups 3 @@ -126,14 +120,14 @@

<%= Danbooru.config.canonical_app_name %> Gold lets you do more complicated searches, and it lets you see hidden tags that non-Gold users can't see. You can search more tags at once, browser deeper in search - results, and also keep more favorites, favorite groups, and saved searches.

+ results, and also keep more favorite groups and saved searches.

What are the benefits of <%= Danbooru.config.canonical_app_name %> Platinum?

Platinum is like Gold, but it lets you search even more tags at once, - and keep even more favorites, favorite groups, and saved searches.

+ and keep even more favorite groups and saved searches.

diff --git a/test/unit/favorite_test.rb b/test/unit/favorite_test.rb index c4536442f..e86d42568 100644 --- a/test/unit/favorite_test.rb +++ b/test/unit/favorite_test.rb @@ -47,12 +47,5 @@ class FavoriteTest < ActiveSupport::TestCase assert_equal("You have already favorited this post", error.message) assert_equal(1, @user1.favorite_count) end - - should "not allow exceeding the user's favorite limit" do - @user1.stubs(:favorite_limit).returns(0) - error = assert_raises(Favorite::Error) { @p1.add_favorite!(@user1) } - - assert_equal("You can only keep up to 0 favorites. Upgrade your account to save more.", error.message) - end end end