mailr/app/models/server.rb
Wojciech Todryk 37f548ce46 devel
2011-07-27 20:34:30 +02:00

19 lines
301 B
Ruby
Executable file

class Server < ActiveRecord::Base
validates_presence_of :name
belongs_to :user
before_save :fill_params
def self.primary
first
end
private
def fill_params
self.port = $defaults['imap_port']
$defaults['imap_use_ssl'] == true ? self.use_ssl = 1 : self.use_ssl = 0
end
end