Skip to content

Commit

Permalink
use flat concatenation instead of nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai-Kircher committed Nov 17, 2022
1 parent 7c99c59 commit afa7f51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cancan/model_adapters/active_record_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit afa7f51

Please sign in to comment.