Enable the Layout/SpaceAfterComma cop
This commit is contained in:
parent
cc32516c21
commit
8b0b8162f0
8 changed files with 17 additions and 17 deletions
|
@ -22,7 +22,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
|
|||
end
|
||||
|
||||
def sanitize_name(name) # from https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/sanitized_file.rb#L323
|
||||
name = name.gsub(/[^[:word:]\.\-\+]/,"_")
|
||||
name = name.gsub(/[^[:word:]\.\-\+]/, "_")
|
||||
name = "_#{name}" if name.match?(/\A\.+\z/)
|
||||
name = "unnamed" if name.empty?
|
||||
return name.mb_chars.to_s
|
||||
|
|
|
@ -19,11 +19,11 @@ namespace :'2018_01_18_clean_datetime_in_champs' do
|
|||
|
||||
# Match "ddmmYYYY HH:MM" => "YYYY-mm-dd HH:MM"
|
||||
datetime_champs.select { |c| /^\d{8}\s\d{2}:\d{2}$/ =~ c.value }.each do |c|
|
||||
day = c.value[0,2]
|
||||
month = c.value[2,2]
|
||||
year = c.value[4,4]
|
||||
hours = c.value[9,2]
|
||||
minutes = c.value[12,2]
|
||||
day = c.value[0, 2]
|
||||
month = c.value[2, 2]
|
||||
year = c.value[4, 4]
|
||||
hours = c.value[9, 2]
|
||||
minutes = c.value[12, 2]
|
||||
formated_date = "#{year}-#{month}-#{day} #{hours}:#{minutes}"
|
||||
rake_puts "cleaning #{c.value} => #{formated_date}"
|
||||
c.update_columns(value: formated_date)
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace :admin do
|
|||
task :create_admin, [:email] => :environment do |t, args|
|
||||
email = args[:email]
|
||||
puts "Creating Administration for #{email}"
|
||||
a = Administration.new(email: email, password: Devise.friendly_token[0,20])
|
||||
a = Administration.new(email: email, password: Devise.friendly_token[0, 20])
|
||||
if a.save
|
||||
puts "#{a.email} created"
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue