diff --git a/lib/axr/model.rb b/lib/axr/model.rb index 0f63a5d..982d89a 100644 --- a/lib/axr/model.rb +++ b/lib/axr/model.rb @@ -25,9 +25,9 @@ def ajaxful_rateable(options = {}) has_many :raters_without_dimension, :through => :rates_without_dimension, :source => :rater options[:dimensions].each do |dimension| - has_many "#{dimension}_rates", :dependent => :destroy, + has_many :"#{dimension}_rates", :dependent => :destroy, :conditions => {:dimension => dimension.to_s}, :class_name => 'Rate', :as => :rateable - has_many "#{dimension}_raters", :through => "#{dimension}_rates", :source => :rater + has_many :"#{dimension}_raters", :through => "#{dimension}_rates", :source => :rater end if options[:dimensions].is_a?(Array) class << self