Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
include decimal in numeric column types
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jan 9, 2012
1 parent dcc30d4 commit ff7bc67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pacecar/helpers.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/dummy/db/migrate/20100419201348_create_schema.rb
Expand Up @@ -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|
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers_spec.rb
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit ff7bc67

Please sign in to comment.