mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
22 lines
433 B
Ruby
22 lines
433 B
Ruby
class Reference < ActiveRecord::Base
|
|
belongs_to :person
|
|
belongs_to :job
|
|
|
|
class << self
|
|
attr_accessor :make_comments
|
|
end
|
|
|
|
before_destroy :make_comments
|
|
|
|
def make_comments
|
|
if self.class.make_comments
|
|
person.update_attributes :comments => "Reference destroyed"
|
|
end
|
|
end
|
|
end
|
|
|
|
class BadReference < ActiveRecord::Base
|
|
self.table_name ='references'
|
|
default_scope :conditions => {:favourite => false }
|
|
end
|