mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-11 19:58:51 +01:00
Make the latest migration behave well in the case of a missing refresh preference value. Patch provided by Blair Zajac. Thanks, Blair! Closes #382.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@323 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
f3223c5474
commit
8b65f1e8ee
1 changed files with 5 additions and 0 deletions
|
|
@ -16,6 +16,11 @@ class ConvertPreferences < ActiveRecord::Migration
|
|||
user.preference.due_style = user.preferences['due_style']
|
||||
user.preference.admin_email = user.preferences['admin_email']
|
||||
user.preference.refresh = user.preferences['refresh']
|
||||
|
||||
if user.preference.refresh.blank?
|
||||
user.preference.refresh = 0
|
||||
end
|
||||
|
||||
user.preference.save!
|
||||
end
|
||||
remove_column :users, :preferences
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue