Skip to content

Commit

Permalink
Fixes #65
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed May 24, 2024
1 parent 3314e13 commit a70357e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/article_unit_ratio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class ArticleUnitRatio < ApplicationRecord
belongs_to :article_version

validates :quantity, :sort, :unit, presence: true
validates :quantity, numericality: { greater_than: 0 }
validates :quantity, numericality: { greater_than: 0, less_than: 10**35 }
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def up
t.references :article_version, null: false

t.column :sort, :integer, null: false, index: true
t.column :quantity, :decimal, precision: 8, scale: 3, null: false
t.column :quantity, :decimal, precision: 38, scale: 3, null: false
t.column :unit, :string, length: 3
end

Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
create_table "article_unit_ratios", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.bigint "article_version_id", null: false
t.integer "sort", null: false
t.decimal "quantity", precision: 8, scale: 3, null: false
t.decimal "quantity", precision: 38, scale: 3, null: false
t.string "unit"
t.index ["article_version_id"], name: "index_article_unit_ratios_on_article_version_id"
t.index ["sort"], name: "index_article_unit_ratios_on_sort"
Expand Down

0 comments on commit a70357e

Please sign in to comment.