mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
24 lines
488 B
Ruby
24 lines
488 B
Ruby
class Reference < ActiveRecord::Base
|
|
belongs_to :person
|
|
belongs_to :job
|
|
|
|
has_many :agents_posts_authors, :through => :person
|
|
|
|
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
|