Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Fixing minimum rating for a film to be 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ky1ejs committed Jan 14, 2018
1 parent ec843bb commit fd2f136
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/watch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Watch < ApplicationRecord
belongs_to :user
belongs_to :film

validates :rating, allow_nil: true, numericality: { greater_than_or_equal_to: 1, less_than_or_equal_to: 5 }
validates :rating, allow_nil: true, numericality: { greater_than_or_equal_to: 0.5, less_than_or_equal_to: 5 }

def watched
!self.rating.nil? || !self.comment.nil?
Expand Down

0 comments on commit fd2f136

Please sign in to comment.