Sha256: 21caa4fc6cc057000bbd047edc94136b618b8921ea06e1949e569b45280c7106

Contents?: true

Size: 478 Bytes

Versions: 2

Compression:

Stored size: 478 Bytes

Contents

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 where(:favourite => false)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-nuodb-adapter-2.0.3 test/models/reference.rb
activerecord-nuodb-adapter-2.0 test/models/reference.rb