|
|
|
@ -39,7 +39,7 @@ class UserPreference < ActiveRecord::Base |
|
|
|
|
attr_accessible :hide_mail, :time_zone, :impaired |
|
|
|
|
|
|
|
|
|
# shortcut methods to others hash |
|
|
|
|
attr_accessible :comments_sorting, :warn_on_leaving_unsaved |
|
|
|
|
attr_accessible :comments_sorting, :warn_on_leaving_unsaved, :theme |
|
|
|
|
|
|
|
|
|
after_initialize :init_other_preferences |
|
|
|
|
|
|
|
|
@ -59,6 +59,14 @@ class UserPreference < ActiveRecord::Base |
|
|
|
|
others[:comments_sorting] = order |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def theme |
|
|
|
|
others[:theme] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def theme=(order) |
|
|
|
|
others[:theme] = order |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def warn_on_leaving_unsaved |
|
|
|
|
others.fetch(:warn_on_leaving_unsaved) { '1' } |
|
|
|
|
end |
|
|
|
|