Merge pull request #998 from vipulnsward/remove_map

Some minor cleanups
This commit is contained in:
Sam 2013-06-09 22:28:56 -07:00
commit 9ab0990077
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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