Skip to content

Commit

Permalink
Don't call google search in dashboard if env is dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Francois committed Sep 13, 2013
1 parent 99c81c9 commit cf9f952
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/controllers/admin/dashboard_controller.rb
Expand Up @@ -6,11 +6,11 @@ class Admin::DashboardController < Admin::BaseController
def index
t = Time.new
today = t.strftime("%Y-%m-%d 00:00")

# Since last venue
@newposts_count = Article.published_since(current_user.last_venue).count
@newcomments_count = Feedback.published_since(current_user.last_venue).count

# Today
@statposts = Article.published.where("published_at > ?", today).count
@statsdrafts = Article.drafts.where("created_at > ?", today).count
Expand All @@ -21,10 +21,10 @@ def index
@presumedspam = Comment.presumed_spam.where("created_at > ?", today).count
@confirmed = Comment.ham.where("created_at > ?", today).count
@unconfirmed = Comment.unconfirmed.where("created_at > ?", today).count

@comments = Comment.last_published
@drafts = Article.drafts.where("user_id = ?", current_user.id).limit(5)

@statspam = Comment.spam.count
@inbound_links = inbound_links
@publify_links = publify_dev
Expand Down Expand Up @@ -55,8 +55,8 @@ def publify_version
private

def inbound_links
host = URI.parse(this_blog.base_url).host
return [] if (host.downcase == 'localhost' || host =~ /\.local$/) # don't try to fetch links for local blogs
host = URI.parse(this_blog.base_url).host
return [] if Rails.env.development?
url = "http://www.google.com/search?q=links:#{host}&tbm=blg&output=rss"
parse(url).reverse.compact
end
Expand Down

0 comments on commit cf9f952

Please sign in to comment.