Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit b1407d1

Browse files
committed
add a validation
1 parent 2624454 commit b1407d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/rating.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class Rating < ApplicationRecord
22
belongs_to :user
33
belongs_to :film
4+
5+
validates_inclusion_of :number, :in => 0..5
46
end

0 commit comments

Comments
 (0)