Module: ActsAsStarrable::Starrable::LocalInstanceMethods
- Defined in:
- lib/acts_as_starrable/starrable.rb
Instance Method Summary collapse
Instance Method Details
#average_rating ⇒ Object
26 27 28 29 30 |
# File 'lib/acts_as_starrable/starrable.rb', line 26 def if avg = .average('rating') (avg * 2).round / 2.0 # round to nearest .5 or .0 end end |
#max_rating ⇒ Object
32 33 34 |
# File 'lib/acts_as_starrable/starrable.rb', line 32 def 5 end |
#starrable? ⇒ Boolean
22 23 24 |
# File 'lib/acts_as_starrable/starrable.rb', line 22 def starrable? true end |