Extract constants for controller LIMIT
queries (#32921)
This commit is contained in:
parent
16addf47c7
commit
c511cbcd6c
4 changed files with 12 additions and 4 deletions
|
@ -24,6 +24,8 @@ class Settings::ImportsController < Settings::BaseController
|
|||
lists: false,
|
||||
}.freeze
|
||||
|
||||
RECENT_IMPORTS_LIMIT = 10
|
||||
|
||||
def index
|
||||
@import = Form::Import.new(current_account: current_account)
|
||||
end
|
||||
|
@ -96,6 +98,6 @@ class Settings::ImportsController < Settings::BaseController
|
|||
end
|
||||
|
||||
def set_recent_imports
|
||||
@recent_imports = current_account.bulk_imports.reorder(id: :desc).limit(10)
|
||||
@recent_imports = current_account.bulk_imports.reorder(id: :desc).limit(RECENT_IMPORTS_LIMIT)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue