diff --git a/lib/pacecar/helpers.rb b/lib/pacecar/helpers.rb index 2af9211..f1c0664 100644 --- a/lib/pacecar/helpers.rb +++ b/lib/pacecar/helpers.rb @@ -38,7 +38,7 @@ def non_state_text_and_string_columns end def numeric_column_names - column_names_for_type :integer, :float + column_names_for_type :integer, :float, :decimal end protected diff --git a/spec/dummy/db/migrate/20100419201348_create_schema.rb b/spec/dummy/db/migrate/20100419201348_create_schema.rb index b70de5c..48db8bb 100644 --- a/spec/dummy/db/migrate/20100419201348_create_schema.rb +++ b/spec/dummy/db/migrate/20100419201348_create_schema.rb @@ -10,6 +10,7 @@ def self.up t.text :description t.integer :age t.float :rating + t.decimal :balance t.timestamps end create_table :posts, :force => true do |t| diff --git a/spec/helpers_spec.rb b/spec/helpers_spec.rb index de06b98..229fdbb 100644 --- a/spec/helpers_spec.rb +++ b/spec/helpers_spec.rb @@ -24,7 +24,7 @@ end it "should return non boolean columns for #non_boolean_column_names" do - User.non_boolean_column_names.should == ['id', 'approved_at', 'rejected_at', 'last_posted_on', 'first_name', 'last_name', 'description', 'age', 'rating', 'created_at', 'updated_at'] + User.non_boolean_column_names.should == ['id', 'approved_at', 'rejected_at', 'last_posted_on', 'first_name', 'last_name', 'description', 'age', 'rating', 'balance', 'created_at', 'updated_at'] end it "should return datetime columns for #datetime_column_names" do @@ -36,7 +36,7 @@ end it "should return numeric columns for #numeric_column_names" do - User.numeric_column_names.should == ['id', 'age', 'rating'] + User.numeric_column_names.should == ['id', 'age', 'rating', 'balance'] end end