This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_task | |
self.class.execute { self.prepare!; self } | |
end | |
def self.execute | |
begin | |
ActiveRecord::Base.connection.execute("LOCK TABLE tasks WRITE") | |
tasks = [*yield] | |
ensure | |
ActiveRecord::Base.connection.execute("UNLOCK TABLE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TestObject.any_instance.stubs(:set_initial_state) |
NewerOlder