diff options
| author | rick <technoweenie@gmail.com> | 2008-10-03 15:50:11 -0700 |
|---|---|---|
| committer | rick <technoweenie@gmail.com> | 2008-10-03 15:50:11 -0700 |
| commit | c310d2805ed243fd7587afcc5cec1bbbb9198947 (patch) | |
| tree | 72dea9da58b73893f773084916c4ca0edd90d336 | |
| parent | 7bac6796b22760aa17ebf879e5466e796f1b5110 (diff) | |
add extra LockedPage field so that it would save even if LockedPage#title had not updated
| -rw-r--r-- | test/schema.rb | 2 | ||||
| -rw-r--r-- | test/versioned_test.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/test/schema.rb b/test/schema.rb index 8f36749c7..49e6c0f0c 100644 --- a/test/schema.rb +++ b/test/schema.rb @@ -30,6 +30,7 @@ ActiveRecord::Schema.define(:version => 0) do create_table :locked_pages, :force => true do |t| t.column :lock_version, :integer t.column :title, :string, :limit => 255 + t.column :body, :text t.column :type, :string, :limit => 255 end @@ -37,6 +38,7 @@ ActiveRecord::Schema.define(:version => 0) do t.column :page_id, :integer t.column :lock_version, :integer t.column :title, :string, :limit => 255 + t.column :body, :text t.column :version_type, :string, :limit => 255 t.column :updated_at, :datetime end diff --git a/test/versioned_test.rb b/test/versioned_test.rb index 4c8c89fa3..178b5ca28 100644 --- a/test/versioned_test.rb +++ b/test/versioned_test.rb @@ -225,7 +225,7 @@ class VersionedTest < Test::Unit::TestCase assert_equal 1, p.lock_version assert_equal 1, p.versions(true).size - p.title = 'title' + p.body = 'whoa' assert !p.save_version? p.save assert_equal 2, p.lock_version # still increments version because of optimistic locking |
