Skip to content

Commit

Permalink
sample model and migration to reproduce rails issue 22424
Browse files Browse the repository at this point in the history
-'rails/rails#22424'
-added migration for product model with price as decimal field
-unable to reproduce rails issue 22424
  • Loading branch information
Aditya Shedge committed Nov 27, 2015
1 parent 22fb4c6 commit 92bd9e6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/product.rb
@@ -0,0 +1,2 @@
class Product < ActiveRecord::Base
end
9 changes: 9 additions & 0 deletions db/migrate/20151127153841_create_products.rb
@@ -0,0 +1,9 @@
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.decimal :price, precision: 12, scale: 2

t.timestamps null: false
end
end
end
8 changes: 7 additions & 1 deletion db/schema.rb
Expand Up @@ -11,6 +11,12 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 0) do
ActiveRecord::Schema.define(version: 20151127153841) do

create_table "products", force: :cascade do |t|
t.decimal "price", precision: 12, scale: 2
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end
7 changes: 7 additions & 0 deletions test/fixtures/products.yml
@@ -0,0 +1,7 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
price: 9.99

two:
price: 9.99
7 changes: 7 additions & 0 deletions test/models/product_test.rb
@@ -0,0 +1,7 @@
require 'test_helper'

class ProductTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 92bd9e6

Please sign in to comment.