2008-04-25 18:23:48 -04:00
|
|
|
class Reference < ActiveRecord::Base
|
|
|
|
belongs_to :person
|
|
|
|
belongs_to :job
|
2010-10-31 07:21:28 -04:00
|
|
|
|
2010-10-09 17:00:33 -04:00
|
|
|
has_many :agents_posts_authors, :through => :person
|
2011-03-02 16:24:56 -05:00
|
|
|
|
2011-02-01 17:56:04 -05:00
|
|
|
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
|
2008-04-25 18:23:48 -04:00
|
|
|
end
|
2010-07-19 21:26:57 -04:00
|
|
|
|
|
|
|
class BadReference < ActiveRecord::Base
|
2011-04-03 19:07:45 -04:00
|
|
|
self.table_name = 'references'
|
2011-04-18 18:15:38 -04:00
|
|
|
default_scope where(:favourite => false)
|
2010-07-19 21:26:57 -04:00
|
|
|
end
|