mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Harmonize Newa :limit option naming
This commit is contained in:
@@ -32,7 +32,7 @@ module Homescreen
|
||||
module Blocks
|
||||
class News < Grids::WidgetComponent
|
||||
def call
|
||||
render(Grids::Widgets::News.new(news_limit: 3))
|
||||
render(Grids::Widgets::News.new(limit: 3))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,9 +31,14 @@
|
||||
module Grids
|
||||
module Widgets
|
||||
class News < Grids::WidgetComponent
|
||||
NEWS_LIMIT = 5
|
||||
private_constant :NEWS_LIMIT
|
||||
|
||||
param :project, optional: true
|
||||
|
||||
def initialize(*, news_limit: 5)
|
||||
option :limit, default: -> { NEWS_LIMIT }
|
||||
|
||||
def initialize(...)
|
||||
super
|
||||
|
||||
@news =
|
||||
@@ -46,7 +51,7 @@ module Grids
|
||||
.includes(:project)
|
||||
end
|
||||
|
||||
@newest = @news.limit(news_limit).to_a
|
||||
@newest = @news.limit(limit).to_a
|
||||
end
|
||||
|
||||
def title
|
||||
|
||||
Reference in New Issue
Block a user