diff --git a/CHANGELOG.md b/CHANGELOG.md index cf62f77..8eb0f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## master (unreleased) - Support sorting of trigger names alphabetically (defaults to false) + ```ruby Logdize.sort_triggers_by_name = true ``` diff --git a/README.md b/README.md index fa4814f..416042a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/logidze.rb b/lib/logidze.rb index 0dcb3af..05849c7 100644 --- a/lib/logidze.rb +++ b/lib/logidze.rb @@ -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