Navigation Menu

Skip to content

Commit

Permalink
Add create_or_find_by to save_bang.rb (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeLaurenty authored and koic committed Aug 9, 2019
1 parent 965cd51 commit 3902899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,7 @@

* [#98](https://github.com/rubocop-hq/rubocop-rails/pull/98): Mark `Rails/ActiveRecordAliases` as `SafeAutoCorrect` false and disable autocorrect by default. ([@prathamesh-sonpatki][])
* [#101](https://github.com/rubocop-hq/rubocop-rails/pull/101): Mark `Rails/SaveBang` as `SafeAutoCorrect` false and disable autocorrect by default. ([@prathamesh-sonpatki][])
* [#102](https://github.com/rubocop-hq/rubocop-rails/pull/102): Include `create_or_find_by` in `Rails/SaveBang` cop. ([@MaximeLaurenty][])

## 2.2.1 (2019-07-13)

Expand Down Expand Up @@ -60,3 +61,4 @@
[@brunvez]: https://github.com/brunvez
[@santib]: https://github.com/santib
[@prathamesh-sonpatki]: https://github.com/prathamesh-sonpatki
[@MaximeLaurenty]: https://github.com/MaximeLaurenty
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rails/save_bang.rb
Expand Up @@ -108,7 +108,7 @@ class SaveBang < Cop
CREATE_CONDITIONAL_MSG = '`%<current>s` returns a model which is ' \
'always truthy.'

CREATE_PERSIST_METHODS = %i[create
CREATE_PERSIST_METHODS = %i[create create_or_find_by
first_or_create find_or_create_by].freeze
MODIFY_PERSIST_METHODS = %i[save
update update_attributes destroy].freeze
Expand Down

0 comments on commit 3902899

Please sign in to comment.