Use Ruby safe navigation over Rails try

re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/SafeNavigation
This commit is contained in:
James Mason 2018-05-08 14:17:30 -07:00
parent d8bd269a64
commit 24396d35c2
11 changed files with 26 additions and 27 deletions

View file

@ -44,7 +44,7 @@ class PictureUploader < CarrierWave::Uploader::Base
# Returns the id of the instance in a split path form. e.g. returns
# 000/001/234 for an id of 1234. Stolen from paperclip...
def id_partition
('%09d'.freeze % model.id).scan(/\d{3}/).join('/'.freeze)
format('%09d', model.id).scan(/\d{3}/).join('/')
end
# Override the directory where uploaded files will be stored.