Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request mbleigh#403 from shekibobo/fix-heroku-precompile
Browse files Browse the repository at this point in the history
Check to see if we can connect to the db before accessing it. Fixes mbleigh#396.
  • Loading branch information
bf4 committed Dec 10, 2013
2 parents 6039ab1 + b4f811d commit f8b46d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ActsAsTaggableOn::Taggable
module Cache
def self.included(base)
# Skip adding caching capabilities if table not exists or no cache columns exist
return unless base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }
return unless base.connected? && base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }

base.send :include, ActsAsTaggableOn::Taggable::Cache::InstanceMethods
base.extend ActsAsTaggableOn::Taggable::Cache::ClassMethods
Expand Down

0 comments on commit f8b46d9

Please sign in to comment.