mailr/app/models/prefs.rb

20 lines
428 B
Ruby
Raw Normal View History

2011-07-24 15:56:47 +02:00
class Prefs < ActiveRecord::Base
validates_presence_of :theme,:locale
has_one :user
protected
2011-09-03 13:07:40 +02:00
def self.create_default(user)
Prefs.create(:user_id => user.id,
2011-07-24 15:56:47 +02:00
:theme => $defaults['theme'],
:locale => $defaults['locale'],
:msgs_per_page => $defaults['msgs_per_page'],
:msg_send_type => $defaults['msg_send_type']
)
end
end
2011-08-16 20:05:58 +02:00
# TODO move refresh to prefs and make refresh page with messages