rails_best_practices icon indicating copy to clipboard operation
rails_best_practices copied to clipboard

False positive : check 'save' return value or use 'save!'

Open pierallard opened this issue 9 years ago • 1 comments

Hi everybody

I think I found a false positive using rails_best_practices, with this type of line:

@success = [email protected]

It can be a weird line, but I want to be sure that @success is a boolean. I get this error : check 'save' return value or use 'save!', even if I check the result. I have the same error with @success = [email protected]_attribute(...)

pierallard avatar Apr 03 '15 16:04 pierallard

Using !! doesn't really make sense here – ActiveRecord's save will always return true or false.

andyw8 avatar May 04 '15 12:05 andyw8