diff --git a/app/models/group.rb b/app/models/group.rb index 7d94e4736c9..d4fca9fa23f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -70,7 +70,7 @@ class Group < ActiveRecord::Base def self.refresh_automatic_groups!(*args) if args.length == 0 - args = AUTO_GROUPS.map{|k,v| k} + args = AUTO_GROUPS.keys end args.each do |group| refresh_automatic_group!(group) diff --git a/app/models/incoming_links_report.rb b/app/models/incoming_links_report.rb index 9060284dd8f..34a984af287 100644 --- a/app/models/incoming_links_report.rb +++ b/app/models/incoming_links_report.rb @@ -94,10 +94,10 @@ class IncomingLinksReport num_clicks = num_clicks.to_a.sort_by {|x| x[1]}.last(10).reverse # take the top 10 report.data = [] topics = Topic.select('id, slug, title').where('id in (?)', num_clicks.map {|z| z[0]}).all - num_clicks.each do |topic_id, num_clicks| + num_clicks.each do |topic_id, num_clicks_element| topic = topics.find {|t| t.id == topic_id} if topic - report.data << {topic_id: topic_id, topic_title: topic.title, topic_slug: topic.slug, num_clicks: num_clicks} + report.data << {topic_id: topic_id, topic_title: topic.title, topic_slug: topic.slug, num_clicks: num_clicks_element} end end report.data diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index 93fee5b34ba..c31fd0cd63b 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -241,7 +241,7 @@ class SiteSetting < ActiveRecord::Base def self.homepage # TODO objectify this - x = top_menu.split('|')[0].split(',')[0] + top_menu.split('|')[0].split(',')[0] end def self.anonymous_homepage