Sha256: 6641d5a8803b73b0c644067a6ed0a2e3f33bee0f9b47ed79e619e88883c5705d
Contents?: true
Size: 1.12 KB
Versions: 91
Compression:
Stored size: 1.12 KB
Contents
class User < ActiveRecord::Base has_many :posts has_many :dogs, :foreign_key => :owner_id, :class_name => "Pets::Dog" has_many :cats, :foreign_key => :owner_id, :class_name => "Pets::Cat" has_many :friendships has_many :friends, :through => :friendships has_one :address, :as => :addressable, :dependent => :destroy has_one :registration has_one :profile, :through => :registration scope :old, :conditions => "age > 50" scope :eighteen, :conditions => { :age => 18 } scope :recent, lambda {|count| { :limit => count } } def self.recent_via_method(count) scoped(:limit => count) end attr_protected :password attr_readonly :name validates_format_of :email, :with => /\w*@\w*.com/ validates_length_of :email, :in => 1..100 validates_numericality_of :age, :greater_than_or_equal_to => 1, :less_than_or_equal_to => 100 validates_acceptance_of :eula validates_uniqueness_of :email, :scope => :name, :case_sensitive => false validates_length_of :ssn, :is => 9, :message => "Social Security Number is not the right length" validates_numericality_of :ssn end
Version data entries
91 entries across 61 versions & 10 rubygems