about summary refs log tree commit diff stats
path: root/app/models/pokeviewer/revision_move.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/pokeviewer/revision_move.rb')
-rw-r--r--app/models/pokeviewer/revision_move.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/pokeviewer/revision_move.rb b/app/models/pokeviewer/revision_move.rb new file mode 100644 index 0000000..74b9e9e --- /dev/null +++ b/app/models/pokeviewer/revision_move.rb
@@ -0,0 +1,19 @@
1module Pokeviewer
2 class RevisionMove < ApplicationRecord
3 belongs_to :revision
4 belongs_to :move
5
6 validates :number, presence: true,
7 numericality: {
8 greater_than_or_equal_to: 1,
9 less_than_or_equal_to: 4,
10 only_integer: true },
11 uniqueness: { scope: :revision_id }
12
13 validates :pp_bonuses, presence: true,
14 numericality: {
15 greater_than_or_equal_to: 0,
16 less_than_or_equal_to: 3,
17 only_integer: true}
18 end
19end