रेल 4 ने उपयोग करते समय एक बहिष्करण चेतावनी पेश की है: uniq => true है has_many: through। उदाहरण के लिए:has_many का उपयोग करते समय बहिष्करण चेतावनी: के माध्यम से: रेल में uniq 4
DEPRECATION WARNING: The following options in your Goal.has_many :donors declaration are deprecated: :uniq. Please use a scope block instead. For example, the following:
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'
should be rewritten as the following:
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'
ऊपर has_many घोषणा के पुनर्लेखन के लिए सही तरीका क्या है:
has_many :donors, :through => :donations, :uniq => true
निम्नलिखित चेतावनी पैदावार?
धन्यवाद, यह बहुत अच्छा काम करता है! आपको यह कहां से मिला? मैं इसे कहीं भी दस्तावेज़ीकरण में नहीं ढूंढ पाया है। – mysmallidea
मैंने वास्तव में इसे रेल 4 पुस्तक (यह प्रगति पर है) में अपग्रेडिंग में देखा: http://www.upgradingtorails4.com/ - इसे कहीं और नहीं ढूंढ पाया है। –
इस संक्षिप्त को उत्तर देने के लिए मुश्किल है। आप महोदय, अधिक उन्नयन के लायक हैं। – courtsimas