Rails 3 getting nested records -


मेरा सेटअप: रेल 3.0.9, रूबी 1.9.2

मॉडल: < पूर्व> वर्ग उपयोगकर्ता has_many: पोस्ट है has_many: photos class पोस्ट is_many: user has_many: comments class photo is_to: user has_many: comments class टिप्पणी को सम्मिलित करना है: post is_to: photo

at at उपयोगकर्ता स्तर, मैं user.posts और user.photos से जुड़ी सारी टिप्पणियों को पकड़ना चाहता हूं, यह संभव है और यदि ऐसा है, तो क्या है वाक्यविन्यास?

user.posts.map (और: टिप्पणियाँ) या user.photos.map (और: टिप्पणियाँ)

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

c# - Confused over DLL entry points (entry point not found exception) -