mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 19:20:13 +01:00
Re-wrote all Date-related code to use Datetimes, created a migration to get rid of all date columns in the database, and got rid of Time.now calls that were not time zone-aware. Lots of time zone goodness!
28 lines
No EOL
564 B
Ruby
28 lines
No EOL
564 B
Ruby
class Preference < ActiveRecord::Base
|
|
belongs_to :user
|
|
belongs_to :sms_context, :class_name => 'Context'
|
|
|
|
def self.due_styles
|
|
{ :due_in_n_days => 0, :due_on => 1}
|
|
end
|
|
|
|
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
|
|
|
|
def parse_date(s)
|
|
return nil if s.blank?
|
|
user.at_midnight(Date.strptime(s, date_format))
|
|
end
|
|
|
|
end |