मैं निम्नलिखित संघों कोड है:अज्ञात कुंजी
has_many :rates_without_dimension, :as => :rateable, :class_name => "Rate", :dependent => :destroy,-> { where(:dimension => nil) }
:
Unknown key: :conditions. Valid keys are: :class_name, :class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache
मैं में पहली पंक्ति को बदलने की कोशिश:
has_many :rates_without_dimension, :as => :rateable, :class_name => "Rate",
:dependent => :destroy, :conditions => {:dimension => nil}
has_many :raters_without_dimension, :through => :rates_without_dimension,
:source => :rater
has_one :rate_average_without_dimension, :as => :cacheable,
:class_name => "RatingCache",
:dependent => :destroy, :conditions => {:dimension => nil}
dimensions.each do |dimension|
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_one "#{dimension}_average", :as => :cacheable, :class_name => "RatingCache",
:dependent => :destroy, :conditions => {:dimension => dimension.to_s}
end
यह एक त्रुटि को जन्म देती है लेकिन यह भी एक त्रुटि उठाया, क्या आप मुझे बता सकते हैं कि इसमें क्या गलत है? मैं उदाहरणों में देख के रूप में
बाहरी साइट से स्रोत कोड शामिल करने के लिए प्रश्न संपादित किया गया हो। [एसओ सहायता] से (http://stackoverflow.com/help/how-to-ask): "यदि समस्या का एक लाइव उदाहरण बनाना संभव है जिसे आप लिंक कर सकते हैं (उदाहरण के लिए, http: // पर sqlfiddle.com/ या http://jsbin.com/) फिर ऐसा करें - लेकिन अपने प्रश्न में कोड भी शामिल करें। हर कोई बाहरी साइटों तक नहीं पहुंच सकता है, और लिंक समय के साथ टूट सकते हैं। " – Amadan
आपके संपादन और उद्धरण के लिए धन्यवाद :) –
-> नोटेशन का उपयोग कर त्रुटि क्या थी? – JTG