Module: Rateme::Macros::ClassMethods

Defined in:
lib/rateme/macros.rb

Instance Method Summary collapse

Instance Method Details

#rateme(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rateme/macros.rb', line 9

def rateme(options = {})
  include RequiredMethods

  has_many :ratings, :as => :rateable

  cattr_accessor :minimum_rating_allowed
  cattr_accessor :maximum_rating_allowed

  self.minimum_rating_allowed = options[:from] || 1
  self.maximum_rating_allowed = options[:upto] || 5
end