Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Oct 23, 2024
1 parent bf2cb8d commit 5652ac4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master (unreleased)

- Support sorting of trigger names alphabetically (defaults to false)

```ruby
Logdize.sort_triggers_by_name = true
```
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ If you specify the limit in the trigger definition, then log size will not excee

## Ordering of Triggers in schema.rb

By default, when generating `schema.rb`, Rails will order the triggers based on the id's of their respective tables. This can lead to unneccessary changes being made when utilizing `rails db:prepare`, since the ordering of the tables will now be based off the alphabetical ordering (see [#250](https://github.com/palkan/logidze/issues/250) for more details). To force the ordering to be consistent with `rails db:prepare`, logidze can be configured to order the triggers alphabetically.
By default, when generating `schema.rb`, Rails will order the triggers based on the id's of their respective tables. This can lead to unnecessary changes being made when utilizing `rails db:prepare`, since the ordering of the tables will now be based off the alphabetical ordering (see [#250](https://github.com/palkan/logidze/issues/250) for more details). To force the ordering to be consistent with `rails db:prepare`, Logidze can be configured to order the triggers alphabetically.

```ruby
# config/initializers/logidze.rb

Expand Down
2 changes: 1 addition & 1 deletion lib/logidze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ def with_logidze_setting(name, value)
self.ignore_log_data_by_default = false
self.return_self_if_log_data_is_empty = true
self.on_pending_upgrade = :ignore
self.sort_triggers_by_name = :false
self.sort_triggers_by_name = false
end

0 comments on commit 5652ac4

Please sign in to comment.