Railsã§ActiveRecordï¼DBï¼ã®ãã©ã³ã¶ã¯ã·ã§ã³å¦çããã¹ãããéã®ã¡ã¢ã ãã©ã³ã¶ã¯ã·ã§ã³å¦ç ç°¡åãªä¾ã¨ãã¦ä»¥ä¸ã®ã³ã¼ããèããã class User def destroy_with_transaction User.transaction do destroy raise end end end ãã¹ãã³ã¼ããæ¸ã User#destroy_with_transactionã¯å¿ ãä¾å¤ãèµ·ããã®ã§ããã©ã³ã¶ã¯ã·ã§ã³ã®åãã§ãã¬ã³ã¼ãã¯åé¤ãããªããã¨ã«ãªãããã£ã¦ããã¹ãã³ã¼ãã¯ä»¥ä¸ã®ããã«ãªãããªãããã£ã¯ã¹ãã£ã¨ãã¦users.ymlãããã¨ããã class UserTest < Test::Unit::TestCase self.use_transactional_fixtures = false fixtures :users def setup @bob
{{#tags}}- {{label}}
{{/tags}}