diff --git a/Gemfile b/Gemfile index 6ff2bc6e0..d6bef4cbe 100644 --- a/Gemfile +++ b/Gemfile @@ -29,9 +29,10 @@ gem 'rmagick', :require => "RMagick" gem 'daemons' gem 'net-ssh' gem 'net-sftp' -# gem 'newrelic_rpm' group :development do + gem 'newrelic_rpm' + gem 'ruby-prof' gem 'pry' gem 'awesome_print' end diff --git a/Gemfile.lock b/Gemfile.lock index faabf9931..e9b62f7a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,6 +94,7 @@ GEM net-sftp (2.1.1) net-ssh (>= 2.6.5) net-ssh (2.6.5) + newrelic_rpm (3.5.5.38) nokogiri (1.5.6) ntlm-http (0.1.1) pg (0.12.2) @@ -129,6 +130,7 @@ GEM json (~> 1.4) ref (1.0.2) rmagick (2.13.2) + ruby-prof (0.12.2) sass (3.2.5) sass-rails (3.2.6) railties (~> 3.2.0) @@ -192,11 +194,13 @@ DEPENDENCIES mocha net-sftp net-ssh + newrelic_rpm nokogiri pg (= 0.12.2) pry rails (= 3.2.12) rmagick + ruby-prof sanitize! sass-rails shoulda diff --git a/app/models/post.rb b/app/models/post.rb index 34a89b7ba..652aa22fe 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -618,7 +618,7 @@ class Post < ActiveRecord::Base module CacheMethods def expire_cache(tag_name) - if Post.fast_count("") < 1000 + if Post.fast_count("").to_i < 1000 Cache.delete(Post.count_cache_key("")) end Cache.delete(Post.count_cache_key(tag_name))