chore: Increase custom filter limit from 50 to 1000 per user (#12603)
# Pull Request Template ## Description This PR increases the custom filter limit from 50 to 1000 per user ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Screenshot <img width="1264" height="71" alt="image" src="https://github.com/user-attachments/assets/e12667bb-147c-4115-b8a8-9113fca471db" /> ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
# index_custom_filters_on_user_id (user_id)
|
||||
#
|
||||
class CustomFilter < ApplicationRecord
|
||||
MAX_FILTER_PER_USER = 50
|
||||
belongs_to :user
|
||||
belongs_to :account
|
||||
|
||||
@@ -25,7 +24,7 @@ class CustomFilter < ApplicationRecord
|
||||
validate :validate_number_of_filters
|
||||
|
||||
def validate_number_of_filters
|
||||
return true if account.custom_filters.where(user_id: user_id).size < MAX_FILTER_PER_USER
|
||||
return true if account.custom_filters.where(user_id: user_id).size < Limits::MAX_CUSTOM_FILTERS_PER_USER
|
||||
|
||||
errors.add :account_id, I18n.t('errors.custom_filters.number_of_records')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user