diff --git a/lib/cancan/model_adapters/active_record_adapter.rb b/lib/cancan/model_adapters/active_record_adapter.rb index 33766c0a..04888306 100644 --- a/lib/cancan/model_adapters/active_record_adapter.rb +++ b/lib/cancan/model_adapters/active_record_adapter.rb @@ -202,7 +202,7 @@ def merge_non_empty_conditions(behavior, conditions_hash, sql) when false_sql behavior ? conditions : false_sql else - behavior ? "(#{conditions}) OR (#{sql})" : "not (#{conditions}) AND (#{sql})" + behavior ? "(#{conditions}) OR #{sql}" : "(not (#{conditions}) AND #{sql})" end end