Skip to content

Commit

Permalink
Merged in feature/KWRAV-static-seo-from-routes (pull request #3)
Browse files Browse the repository at this point in the history
KWRAV-566 #Issues fixed
  • Loading branch information
Banura Randika authored and fidenz-kelum committed Apr 20, 2020
2 parents 046ee51 + 5cc8356 commit 87849a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controller/sitemap_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def sitemap
period_sym = period.to_sym
end

if class_names.include? controller
if class_names.include? controller.pluralize
p = controller.capitalize.singularize.camelize
if Object.const_defined?(p) && (%w[destroy update create index new].exclude? action) && p.constantize.any?
p.constantize.all.each do |record|
Expand All @@ -43,6 +43,9 @@ def sitemap
m.add(url_for(controller: controller, action: action, only_path: true),
priority: priority, updated: Date.today, period: period_sym)
end
elsif %w[destroy update create].exclude? action
m.add(url_for(controller: controller, action: action, only_path: true),
priority: priority, updated: Date.today, period: period_sym)
end
end
end
Expand Down

0 comments on commit 87849a0

Please sign in to comment.