Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't include empty arrays, particularly on scope[:joins] because sco…

…pe[:joins].to_s returns strings like #<ActiveRecord::Relation:0x5021304> breaking the subsequent 'joins.join(" ")'

Signed-off-by: Joel Nimety <jnimety@continuity.net>
  • Loading branch information...
commit ec56014e040b9e384339cfa4d6bad7649c813c8d 1 parent a5e855a
@jnimety jnimety authored committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/acts_as_taggable.rb
View
4 lib/acts_as_taggable.rb
@@ -147,8 +147,8 @@ def find_options_for_tag_counts(options = {})
conditions = conditions.join(" AND ")
joins = ["INNER JOIN #{table_name} ON #{table_name}.#{primary_key} = #{Tagging.table_name}.taggable_id"]
- joins << options.delete(:joins) if options[:joins]
- joins << scope[:joins] if scope && scope[:joins]
+ joins << options.delete(:joins) if options[:joins].present?
+ joins << scope[:joins] if scope && scope[:joins].present?
joins = joins.join(" ")
options = { :conditions => conditions, :joins => joins }.update(options)
Please sign in to comment.
Something went wrong with that request. Please try again.