SQLite3 Error - cannot rollback - no transaction is active

后端 未结 3 1692
离开以前
离开以前 2020-12-20 17:52

SOLVED (see below)

When I\'m trying to create or destroy a record (running on SQLite3) in my Ruby on Rails app (or in console as well) I\'m getting an SQL Exceptio

相关标签:
3条回答
  • 2020-12-20 18:20

    It is a good idea to never to make an instance method named "hash". This is used by a ton of ruby objects for comparison and equality. No matter weather your using SQLite, or anything, a custom hash method should only be done when you know what you want from it's results. In this case ActiveRecord made the method for you. I would rename the column :)

    0 讨论(0)
  • 2020-12-20 18:29

    Perhaps you should try to look here: Rails Tests Fail With Sqlite3 Looks like they may have found a workaround.

    0 讨论(0)
  • 2020-12-20 18:33

    Holy smokes... The situation is in-fact that the field name "hash" causes sqlite3 to throw this very unhelpful error. Tricky one...

    0 讨论(0)
提交回复
热议问题