diff --git a/lib/cancan/model_adapters/active_record_adapter.rb b/lib/cancan/model_adapters/active_record_adapter.rb index 9eeefdcb..01ae8063 100644 --- a/lib/cancan/model_adapters/active_record_adapter.rb +++ b/lib/cancan/model_adapters/active_record_adapter.rb @@ -157,7 +157,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