Sha256: b6550826795d4d79a3d1a1d4a30891c952f44a811cabad328069a4dbf5abe7c1

Contents?: true

Size: 395 Bytes

Versions: 4

Compression:

Stored size: 395 Bytes

Contents

class User < ActiveRecord::Base
  has_one :note
  has_many :tasks
  has_many :projects
  has_many :locations
  
  default_methods :full_name, :has_nothing_to_do
  
  validates_length_of :login, :maximum => 10
  
  def full_name
    "#{first_name} #{last_name}"
  end
  
  def has_nothing_to_do
    tasks.all? {|task| task.completed}
  end
  
  def email_host
    email.split('@').last
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
dima-ruboss4ruby-1.1.0 test/rails/models/user.rb
dima-ruboss4ruby-1.1.1 test/rails/models/user.rb
ruboss4ruby-1.1.0 test/rails/models/user.rb
ruboss4ruby-1.1.1 test/rails/models/user.rb