commit

commit()
Instance Public methods

Ends the current #transaction, committing any changes to the data store immediately.

Example:

require "pstore"

store = PStore.new("data_file.pstore")
store.transaction do  # begin transaction
  # load some data into the store...
  store[:one] = 1
  store[:two] = 2

  store.commit        # end transaction here, committing changes

  store[:three] = 3   # this change is never reached
end

WARNING: This method is only valid in a #transaction. It will raise PStore::Error if called at any other time.

doc_ruby_on_rails
2015-04-29 00:44:19
Comments
Leave a Comment

Please login to continue.