निम्नलिखित कोड को देखते हुए:क्या रेल नियंत्रक क्रियाएं लेनदेन संबंधी बंधनों को स्पष्ट रूप से परिभाषित करती हैं?
def create
@something = Something.new(params[:something])
thing = @something.thing # another model
# modification of attributes on both 'something' and 'thing' omitted
# do I need to wrap it inside a transaction block?
@something.save
thing.save
end
विधि बनाने चाहेंगे ActiveRecord लेनदेन परोक्ष में लिपटे जा, या मैं लेनदेन ब्लॉक में रैप करने के लिए की आवश्यकता होगी? अगर मुझे इसे लपेटने की ज़रूरत है, तो क्या यह सबसे अच्छा तरीका होगा?