Sha256: a6183815a4171584b90fae608330f8b73784942330d8d21e2876cf5f5e72d7ed

Contents?: true

Size: 281 Bytes

Versions: 10

Compression:

Stored size: 281 Bytes

Contents

class Earthworm < ActiveRecord::Base
  belongs_to :dirt

  # Earthworms have been known to complain if they're left on their deathbeds without any dirt
  before_destroy :complain!

  def complain!
    raise "Where's my dirt?!" if Dirt.not_deleted.find(self.dirt_id).nil?
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
permanent_records-3.3.0 spec/support/earthworm.rb
permanent_records-3.2.0 spec/support/earthworm.rb
permanent_records-3.1.6 spec/support/earthworm.rb
permanent_records-3.1.5 spec/support/earthworm.rb
permanent_records-3.1.4 spec/support/earthworm.rb
permanent_records-3.1.3 spec/support/earthworm.rb
permanent_records-3.0.3 spec/support/earthworm.rb
permanent_records-3.0.2 spec/support/earthworm.rb
permanent_records-3.0.1 spec/support/earthworm.rb
permanent_records-3.0.0 spec/support/earthworm.rb