tracks/tracks/app/models/preference.rb
lukemelia 2329cb8e1e Introduced user preference for time zone (migration, model and prefs forms)
Made all dates and times stored in UTC in the database and presented according to the User's preferred time zone.
Cleaned up old unused preference methods in UserController
Restored keyboard shortcuts for date field interaction
Aliased preference in User model to prefs for brevity

Don't forget to rake db:migrate for this update!

All tests pass, but there were a lot of little changes involved in this feature. Please help me test it thoroughly if you're using the trunk. 
 
Fixes #349



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@392 a4c988fc-2ded-0310-b66e-134b36920a42
2007-01-06 10:06:33 +00:00

21 lines
No EOL
438 B
Ruby

class Preference < ActiveRecord::Base
belongs_to :user
composed_of :tz,
:class_name => 'TimeZone',
:mapping => %w(time_zone name)
def self.day_number_to_name_map
{ 0 => "Sunday",
1 => "Monday",
2 => "Tuesday",
3 => "Wednesday",
4 => "Thursday",
5 => "Friday",
6 => "Saturday"}
end
def hide_completed_actions?
return show_number_completed == 0
end
end