Skip to content

Commit

Permalink
change limit default to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoyoussef committed Nov 14, 2024
1 parent 8505164 commit a334e4f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/avo/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def initialize
@is_developer_method = :is_developer?
@search_results_count = 8
@first_sorting_option = :desc # :desc or :asc
@associations_query_limit = 2000
@associations_query_limit = 1000
end

def current_user_method(&block)
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/initializer/avo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Avo.configure do |config|
# config.search_results_count = 8

## == Associations query limit on select options ==
# config.associations_query_limit = 2000
# config.associations_query_limit = 1000

## == Cache options ==
## Provide a lambda to customize the cache store used by Avo.
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

config.alert_dismiss_time = 5000
config.search_results_count = 8
config.associations_query_limit = 2000
config.associations_query_limit = 1000

## == Menus ==
if Rails.env.test?
Expand Down
2 changes: 1 addition & 1 deletion spec/system/avo/associations_using_fields_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
let!(:link) { Course::Link.first }

before { Avo.configuration.associations_query_limit = 1 }
after { Avo.configuration.associations_query_limit = 2000 }
after { Avo.configuration.associations_query_limit = 1000 }

it "limits select options" do
visit avo.resources_course_path(course)
Expand Down
4 changes: 2 additions & 2 deletions spec/system/avo/create_via_belongs_to_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
let!(:exceeded_course) { create :course }

before { Avo.configuration.associations_query_limit = 1 }
after { Avo.configuration.associations_query_limit = 2000 }
after { Avo.configuration.associations_query_limit = 1000 }

it "limits select options" do
visit "/admin/resources/course_links/new"
Expand Down Expand Up @@ -144,7 +144,7 @@
let!(:exceeded_user) { create :user }

before { Avo.configuration.associations_query_limit = 1 }
after { Avo.configuration.associations_query_limit = 2000 }
after { Avo.configuration.associations_query_limit = 1000 }

it "limits select options" do
visit "/admin/resources/comments/new"
Expand Down

0 comments on commit a334e4f

Please sign in to comment.