Sha256: b6c240d730ebd0104bf48c43878a491ef62cc0200c529f8dd4d78e4e09a1ec85

Contents?: true

Size: 477 Bytes

Versions: 11

Compression:

Stored size: 477 Bytes

Contents

require File.expand_path("../helper", __FILE__)

class Article < Ohm::Model
  include Ohm::Versioned

  attribute :title
  attribute :content
end

test do
  a1 = Article.create(:title => "Foo Bar", :content => "Lorem ipsum")
  a2 = Article[a1.id]

  a1.update({})

  begin
    a2.update(:title => "Bar Baz")
  rescue Ohm::VersionConflict => ex
  end

  expected = { :title => "Bar Baz", :_version => "1", :content => "Lorem ipsum" }

  assert_equal expected, ex.attributes
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ohm-contrib-2.0.0.alpha5 test/versioned.rb
ohm-contrib-2.0.0.alpha4 test/versioned.rb
ohm-contrib-2.0.0.alpha3 test/versioned.rb
ohm-contrib-2.0.0.alpha2 test/versioned.rb
ohm-contrib-1.2 test/versioned.rb
ohm-contrib-1.1.0 test/versioned.rb
ohm-contrib-1.0.1 test/versioned.rb
ohm-contrib-1.0.0 test/versioned.rb
ohm-contrib-1.0.0.rc5 test/versioned.rb
ohm-contrib-1.0.0.rc4 test/versioned.rb
ohm-contrib-1.0.0.rc3 test/versioned.rb