estimancy/projestimate

View on GitHub
app/models/technology.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Technology < ActiveRecord::Base
  include MasterDataHelper

  belongs_to :record_status
  belongs_to :owner_of_change, :class_name => 'User', :foreign_key => 'owner_id'

  validates :record_status, :presence => true
  validates :uuid, :presence => true, :uniqueness => {:case_sensitive => false}
  validates :name, :presence => true, :uniqueness => {:scope => :record_status_id, :case_sensitive => false}
  validates :custom_value, :presence => true, :if => :is_custom?

  attr_accessible :description, :name, :record_status_id, :custom_value, :change_comment
end