Skip to content

Commit

Permalink
Explicit setting of default date format to fix YAML backup data.
Browse files Browse the repository at this point in the history
  • Loading branch information
huerlisi committed Jun 6, 2014
1 parent abdb469 commit c1be4c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/backup.rb
Expand Up @@ -18,7 +18,14 @@ def self.dump_data(temp)

old_level = ActiveRecord::Base.logger.level
ActiveRecord::Base.logger.level = 2 # don't log debug or info

old_date_format = Date::DATE_FORMATS[:default]
Date::DATE_FORMATS[:default] = '%Y-%m-%d'

YamlDb::Helper.dumper.dump(temp)

Date::DATE_FORMATS[:default] = old_date_format

ActiveRecord::Base.logger.level = old_level

temp.close
Expand Down

0 comments on commit c1be4c9

Please sign in to comment.