diff --git a/lib/ratyrate/model.rb b/lib/ratyrate/model.rb index c9388a7..f966dfb 100644 --- a/lib/ratyrate/model.rb +++ b/lib/ratyrate/model.rb @@ -129,7 +129,7 @@ def ratyrate_rateable(*dimensions) :class_name => "Rate", :as => :rateable - has_many "#{dimension}_raters".to_sym, :through => "#{dimension}_rates", :source => :rater + has_many "#{dimension}_raters".to_sym, :through => :"#{dimension}_rates", :source => :rater has_one "#{dimension}_average".to_sym, -> { where dimension: dimension.to_s }, :as => :cacheable, :class_name => "RatingCache",