Sha256: 6fcda7d053513a786babf286b99b55d402af0fe471b9f4b36c60ed08e614d4b4

Contents?: true

Size: 493 Bytes

Versions: 20

Compression:

Stored size: 493 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
  self.make_comments = false

  before_destroy :make_comments

  def make_comments
    if self.class.make_comments
      person.update comments: "Reference destroyed"
    end
  end
end

class BadReference < ActiveRecord::Base
  self.table_name = 'references'
  default_scope { where(:favourite => false) }
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
ibm_db-5.2.0 test/models/reference.rb
ibm_db-5.1.0 test/models/reference.rb
ibm_db-5.0.5 test/models/reference.rb
ibm_db-5.0.4 test/models/reference.rb
ibm_db-5.0.3 test/models/reference.rb
ibm_db-5.0.2 test/models/reference.rb
ibm_db-4.0.0-x86-mingw32 test/models/reference.rb
ibm_db-4.0.0 test/models/reference.rb
ibm_db-3.0.4-x86-mingw32 test/models/reference.rb
ibm_db-3.0.4 test/models/reference.rb
ibm_db-3.0.3-x86-mingw32 test/models/reference.rb
ibm_db-3.0.3 test/models/reference.rb
ibm_db-3.0.2-x86-mingw32 test/models/reference.rb
ibm_db-3.0.2 test/models/reference.rb
activejob-lock-0.0.2 rails/activerecord/test/models/reference.rb
ibm_db-3.0.1 test/models/reference.rb
ibm_db-3.0.1-x86-mingw32 test/models/reference.rb
activejob-lock-0.0.1 rails/activerecord/test/models/reference.rb
activerecord-nuodb-adapter-1.1 test/models/reference.rb
activerecord-nuodb-adapter-1.0.4 test/models/reference.rb