Issue #687: cancan inserting "AND (NULL)" at the end of sql
Ensure that empty conditions does not trigger unmergeable conditions
This commit is contained in:
@@ -55,7 +55,8 @@ module CanCan
|
||||
end
|
||||
|
||||
def unmergeable?
|
||||
@conditions.respond_to?(:keys) && (! @conditions.keys.first.kind_of? Symbol)
|
||||
@conditions.respond_to?(:keys) && @conditions.present? &&
|
||||
(!@conditions.keys.first.kind_of? Symbol)
|
||||
end
|
||||
|
||||
def associations_hash(conditions = @conditions)
|
||||
|
||||
Reference in New Issue
Block a user