You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules_compression.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
1
# Rules compressions
2
2
3
-
Your rules are optimized automatically at runtime. There are a set of "rules" to optimize your rules definition and they are implemented in the `RulesCompressor` class. Here you can see how this works:
3
+
Database are great on optimizing queries, but sometimes cancancan builds `joins` that might lead to slow performance.
4
+
This is why your rules are optimized automatically at runtime.
5
+
There are a set of "rules" to optimize your rules definition and they are implemented in the `RulesCompressor` class.
6
+
You can always disable the rules compressor by setting `CanCan.rules_compressor_enabled = false` in your initializer.
7
+
You can also enable/disable it on a specific check by using: `with_rules_compressor_enabled(false) { ... }`
8
+
9
+
Here you can see how this works:
4
10
5
11
A rule without conditions is defined as `catch_all`.
0 commit comments