Sha256: 6e10b11a296e66a6673b0ef7a9586d355e01b9feeb9359556094034885aec2ee

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 Bytes

Contents

class Mite::Project < Mite::Base
  
  include Mite::ResourceWithActiveArchived
  
  def time_entries(options = {})
    Mite::TimeEntry.find(:all, :params => options.update(:project_id => id))
  end
  
  def name_with_customer
    respond_to?(:customer_name) && !customer_name.blank? ? "#{name} (#{customer_name})" : name
  end
  
  def customer
    @customer ||= Mite::Customer.find(customer_id) unless customer_id.blank?
  end
  
  def customer=(customer)
    self.customer_id = customer ? customer.id : nil
    @customer = customer
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mite-rb-0.4.4 lib/mite/project.rb
mite-rb-0.4.3 lib/mite/project.rb
mite-rb-0.4.2 lib/mite/project.rb
mite-rb-0.4.1 lib/mite/project.rb
mite-rb-0.4.0 lib/mite/project.rb
mite-rb-0.3.0 lib/mite/project.rb
mite-rb-0.2.4 lib/mite/project.rb
mite-rb-0.2.3 lib/mite/project.rb