Harmonize Newa :limit option naming

This commit is contained in:
Alexander Brandon Coles
2025-10-13 20:42:10 +01:00
parent 4b819e01fc
commit db7f964f8a
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -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