Class: Rateable::Rate

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/rateable/rate.rb

Instance Method Summary collapse

Instance Method Details

#stars_must_be_in_rangeObject

[View source]

10
11
12
13
14
# File 'lib/rateable/rate.rb', line 10

def stars_must_be_in_range 
  unless (1..rateable.max_stars).include? stars
    errors.add :stars, "must be within 1 to #{rateable.max_stars}"
  end
end