lib/milestoner/syndication/builder.rb in milestoner-18.6.0 vs lib/milestoner/syndication/builder.rb in milestoner-18.7.0
- old
+ new
@@ -12,10 +12,16 @@
include Import[:settings]
include Dry::Monads[:result]
using Refine
+ def self.authors_for tags
+ tags.flat_map { |tag| tag.commits.map(&:author) }
+ .then { |users| users.any? ? users : tags.map(&:author) }
+ .uniq
+ end
+
def initialize(client: RSS::Maker, view: Views::Milestones::Show.new, **)
super(**)
@client = client
@view = view
end
@@ -54,13 +60,10 @@
end
def build_channel_elements node, tags
build_links node
build_generator node
-
- build_authors node,
- tags.flat_map { |tag| tag.commits.map(&:author) }
- .uniq
+ build_authors node, self.class.authors_for(tags)
node.categories.build label: settings.project_label, term: settings.project_name
end
def build_links node