Sha256: 8edb4fc70f6f48edafb3efd1b659585e7ba9a678f497557c778c2c6b35d800f5

Contents?: true

Size: 374 Bytes

Versions: 19

Compression:

Stored size: 374 Bytes

Contents

require 'purgatory'

class Animal < ActiveRecord::Base
  before_create :set_original_name

  private

  def set_original_name
    self.original_name = name
  end
end

class Dog < Animal
  use_purgatory
  validates :name, presence: true

  DEFAULT_PRICE = 100

  before_create :set_price

  private

  def set_price
    self.price = DEFAULT_PRICE unless self.price
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
purgatory-6.0.3 spec/support/animal.rb
purgatory-6.0.2 spec/support/animal.rb
purgatory-6.0.1 spec/support/animal.rb
purgatory-6.0.0 spec/support/animal.rb
purgatory-4.0.0 spec/support/animal.rb
purgatory-3.1.2 spec/support/animal.rb
purgatory-3.1.1 spec/support/animal.rb
purgatory-3.1.0 spec/support/animal.rb
purgatory-3.0.0 spec/support/animal.rb
purgatory-2.14.0 spec/support/animal.rb
purgatory-2.13.0 spec/support/animal.rb
purgatory-2.12.0 spec/support/animal.rb
purgatory-2.11.0 spec/support/animal.rb
purgatory-2.10.0 spec/support/animal.rb
purgatory-2.9.0 spec/support/animal.rb
purgatory-2.8.0 spec/support/animal.rb
purgatory-2.7.0 spec/support/animal.rb
purgatory-2.6.0 spec/support/animal.rb
purgatory-2.5.0 spec/support/animal.rb