Merge pull request #998 from vipulnsward/remove_map
Some minor cleanups
This commit is contained in:
commit
9ab0990077
|
@ -70,7 +70,7 @@ class Group < ActiveRecord::Base
|
||||||
|
|
||||||
def self.refresh_automatic_groups!(*args)
|
def self.refresh_automatic_groups!(*args)
|
||||||
if args.length == 0
|
if args.length == 0
|
||||||
args = AUTO_GROUPS.map{|k,v| k}
|
args = AUTO_GROUPS.keys
|
||||||
end
|
end
|
||||||
args.each do |group|
|
args.each do |group|
|
||||||
refresh_automatic_group!(group)
|
refresh_automatic_group!(group)
|
||||||
|
|
|
@ -94,10 +94,10 @@ class IncomingLinksReport
|
||||||
num_clicks = num_clicks.to_a.sort_by {|x| x[1]}.last(10).reverse # take the top 10
|
num_clicks = num_clicks.to_a.sort_by {|x| x[1]}.last(10).reverse # take the top 10
|
||||||
report.data = []
|
report.data = []
|
||||||
topics = Topic.select('id, slug, title').where('id in (?)', num_clicks.map {|z| z[0]}).all
|
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}
|
topic = topics.find {|t| t.id == topic_id}
|
||||||
if topic
|
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
|
||||||
end
|
end
|
||||||
report.data
|
report.data
|
||||||
|
|
|
@ -241,7 +241,7 @@ class SiteSetting < ActiveRecord::Base
|
||||||
|
|
||||||
def self.homepage
|
def self.homepage
|
||||||
# TODO objectify this
|
# TODO objectify this
|
||||||
x = top_menu.split('|')[0].split(',')[0]
|
top_menu.split('|')[0].split(',')[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.anonymous_homepage
|
def self.anonymous_homepage
|
||||||
|
|
Loading…
Reference in New Issue