Skip to content

Commit

Permalink
[ifmeorg#1713] match resource tag with moment category name and descr…
Browse files Browse the repository at this point in the history
…iption
  • Loading branch information
S-Warmenhoven committed Apr 8, 2020
1 parent 8c77f7b commit f8592bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/services/resource_recommendation.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include PagesConcern

class ResourceRecommendation

def initialize(moment)
@moment = moment
end
Expand All @@ -13,6 +12,13 @@ def resources
moment_name = @moment.name.split
moment_why = @moment.why.split
moment_fix = @moment.fix.split
@moment.categories.each do |category|
moment_keywords.push(category['name'].split)
end
@moment.categories.each do |category|
category_description = category['description']
moment_keywords.push(category_description.split)
end
moment_keywords.push(moment_name, moment_why, moment_fix)
moment_keywords = moment_keywords.flatten
moment_keywords = moment_keywords.map(&:downcase)
Expand Down

0 comments on commit f8592bf

Please sign in to comment.