From 89622a241379d64c484372de0cb2836579481fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20B=C3=B6ttger?= Date: Wed, 22 Feb 2012 15:25:43 +1300 Subject: [PATCH] fixing tests (providing default column in test tables) --- lib/aasm/persistence/active_record_persistence.rb | 2 +- spec/schema.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/aasm/persistence/active_record_persistence.rb b/lib/aasm/persistence/active_record_persistence.rb index 031f072..8f62d4c 100644 --- a/lib/aasm/persistence/active_record_persistence.rb +++ b/lib/aasm/persistence/active_record_persistence.rb @@ -159,7 +159,7 @@ module AASM # foo.aasm_state # => nil # def aasm_ensure_initial_state - send("#{self.class.aasm_column}=", self.aasm_enter_initial_state.to_s) if send(self.class.aasm_column).blank? + aasm_enter_initial_state if send(self.class.aasm_column).blank? end end diff --git a/spec/schema.rb b/spec/schema.rb index f211832..c02c960 100644 --- a/spec/schema.rb +++ b/spec/schema.rb @@ -1,7 +1,9 @@ ActiveRecord::Schema.define(:version => 0) do %w{gates readers writers transients simples thieves localizer_test_models}.each do |table_name| - create_table table_name, :force => true + create_table table_name, :force => true do |t| + t.string "aasm_state" + end end create_table "validators", :force => true do |t|