Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for issue 560 where joins could be thrown away by ActiveRecordAda…

…pter::merge_joins
  • Loading branch information...
commit cfc355c006a3f531e4024e4cd54cbc4740f8635a 1 parent 7bf683d
David Simon authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cancan/model_adapters/active_record_adapter.rb
4 lib/cancan/model_adapters/active_record_adapter.rb
View
@@ -145,8 +145,8 @@ def sanitize_sql(conditions)
# Takes two hashes and does a deep merge.
def merge_joins(base, add)
add.each do |name, nested|
- if base[name].is_a?(Hash) && !nested.empty?
- merge_joins(base[name], nested)
+ if base[name].is_a?(Hash)
+ merge_joins(base[name], nested) unless nested.empty?
else
base[name] = nested
end
Please sign in to comment.
Something went wrong with that request. Please try again.