public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Michael Hartl (author)
Wed May 07 12:08:42 -0700 2008
commit  ca931746525b469a2384bb1414adc6a0186ab9bc
tree    48ce3bb0901c35a74945920ef4a86dc4f495e39c
parent  ed4fb244bd0c174df2814784e443cffa1a12d9b1
insoshi / app / models / preference.rb
100644 31 lines (26 sloc) 0.966 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# == Schema Information
# Schema version: 20
#
# Table name: preferences
#
# id :integer(11) not null, primary key
# domain :string(255) default(""), not null
# smtp_server :string(255) default(""), not null
# email_notifications :boolean(1) not null
# email_verifications :boolean(1) not null
# created_at :datetime
# updated_at :datetime
# analytics :text
# server_name :string(255)
# app_name :string(255)
#
 
class Preference < ActiveRecord::Base
  attr_accessible :app_name, :server_name, :domain, :smtp_server,
                  :email_notifications, :email_verifications, :analytics
 
  validates_presence_of :domain, :if => :using_email?
  validates_presence_of :smtp_server, :if => :using_email?
  
  private
  
    def using_email?
      email_notifications? or email_verifications?
    end
end