Sha256: 3beda18c074a4633ea8f0c943dc7eca849f6b0799d5641744cbac74bdc635a69

Contents?: true

Size: 292 Bytes

Versions: 9

Compression:

Stored size: 292 Bytes

Contents

require 'purgatory'

class Widget < ActiveRecord::Base
  use_purgatory
  validates :name, presence: true
  before_create :set_original_name
  
  def rename(new_name)
    self.update_attributes(name: new_name)
  end

  private
  
  def set_original_name
    self.original_name = name
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
purgatory-6.0.3 spec/support/widget.rb
purgatory-6.0.2 spec/support/widget.rb
purgatory-6.0.1 spec/support/widget.rb
purgatory-6.0.0 spec/support/widget.rb
purgatory-4.0.0 spec/support/widget.rb
purgatory-3.1.2 spec/support/widget.rb
purgatory-3.1.1 spec/support/widget.rb
purgatory-3.1.0 spec/support/widget.rb
purgatory-3.0.0 spec/support/widget.rb