Skip to content

Commit

Permalink
Small improvements on README (#365)
Browse files Browse the repository at this point in the history
- Add supported Ruby versions
- Enable syntax highlighting on Ruby code snippet
  • Loading branch information
ybiquitous committed Mar 4, 2023
1 parent c4559bd commit 726dc7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ Turbo-charged counter caches for your Rails app. Huge improvements over the Rail
* Supports dynamic column names, making it possible to split up the counter cache for different types of objects
* Can keep a running count, or a running total

Tested against Ruby 2.6, 2.7 and 3.0, and against the latest patch releases of Rails 5.2, 6.0, 6.1 and 7.0.
Tested against Ruby 2.6, 2.7, 3.0, 3.1 and 3.2, and against the latest patch releases of Rails 5.2, 6.0, 6.1 and 7.0.

Please note that -- unlike Rails' built-in counter-caches -- counter_culture does not currently change the behavior of the `.size` method on ActiveRecord associations. If you want to avoid a database query and read the cached value, please use the attribute name containing the counter cache directly.
```

```ruby
product.categories.size # => will lead to a SELECT COUNT(*) query
product.categories_count # => will use counter cache without query
```
Expand Down

0 comments on commit 726dc7b

Please sign in to comment.