From d9e0418ea27e61f799883e822a91d1e23667ce06 Mon Sep 17 00:00:00 2001 From: Nicolas Braem Date: Wed, 17 Oct 2012 11:21:24 +0200 Subject: [PATCH] fix join on association --- lib/axr/model.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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