From b3a42bd57175e89dd9aec8e2ed1b8e227d1a3c23 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Tue, 6 Feb 2018 17:59:42 -0200 Subject: [PATCH] up: enables billion of precision on decimal field --- .../rating/templates/db/migrate/create_rating_tables.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/generators/rating/templates/db/migrate/create_rating_tables.rb b/lib/generators/rating/templates/db/migrate/create_rating_tables.rb index af1ac28..f0edbeb 100644 --- a/lib/generators/rating/templates/db/migrate/create_rating_tables.rb +++ b/lib/generators/rating/templates/db/migrate/create_rating_tables.rb @@ -3,7 +3,7 @@ class CreateRatingTables < ActiveRecord::Migration[5.0] def change create_table :rating_rates do |t| - t.decimal :value, default: 0, precision: 17, scale: 14 + t.decimal :value, default: 0, precision: 25, scale: 16 t.references :author, index: true, null: false, polymorphic: true t.references :resource, index: true, null: false, polymorphic: true @@ -17,8 +17,8 @@ class CreateRatingTables < ActiveRecord::Migration[5.0] unique: true create_table :rating_ratings do |t| - t.decimal :average, default: 0, mull: false, precision: 17, scale: 14 - t.decimal :estimate, default: 0, mull: false, precision: 17, scale: 14 + t.decimal :average, default: 0, mull: false, precision: 25, scale: 16 + t.decimal :estimate, default: 0, mull: false, precision: 25, scale: 16 t.integer :sum, default: 0, mull: false t.integer :total, default: 0, mull: false