pools: allow new users to remove posts from pools.

Remove the rule that users less than a week old can't remove posts from
pools.
This commit is contained in:
evazion
2020-03-21 22:19:35 -05:00
parent 92e4635af8
commit aefbed57b8
3 changed files with 1 additions and 15 deletions

View File

@@ -7,7 +7,6 @@ class Pool < ApplicationRecord
validates_uniqueness_of :name, case_sensitive: false, if: :name_changed?
validate :validate_name, if: :name_changed?
validates_inclusion_of :category, :in => %w(series collection)
validate :updater_can_remove_posts
validate :updater_can_edit_deleted
before_validation :normalize_post_ids
before_validation :normalize_name
@@ -173,7 +172,6 @@ class Pool < ApplicationRecord
def remove!(post)
return unless contains?(post.id)
return unless CurrentUser.user.can_remove_from_pools?
with_lock do
reload
@@ -276,11 +274,4 @@ class Pool < ApplicationRecord
errors[:name] << "cannot contain only digits"
end
end
def updater_can_remove_posts
removed = post_ids_was - post_ids
if removed.any? && !CurrentUser.user.can_remove_from_pools?
errors[:base] << "You cannot removes posts from pools within the first week of sign up"
end
end
end