after_rollback(*args, &block) Instance Public methods This callback is called after a create, update, or destroy are rolled back. Please check the documentation of after_commit for options.
transaction(options = {}, &block) Instance Public methods See ActiveRecord::Transactions::ClassMethods for detailed documentation.
add_to_transaction() Instance Public methods Add the record to the current transaction so that the after_rollback and after_commit callbacks can be called.
rollback_active_record_state!() Instance Public methods Reset id and @new_record if the transaction rolls back.
with_transaction_returning_status() Instance Public methods Executes method within a transaction and captures its return value as a status flag. If the status is true the transaction is committed, otherwise a ROLLBACK is issued. In any case the status flag is returned. This method is available within the context of an ActiveRecord::Base instance.
new(record, attribute) Class Public methods
new(model) Class Public methods
create!(attributes = nil, &block) Instance Public methods Creates an object just like Base.create but calls save! instead of save so an exception is raised if the record is invalid.
validates_associated(*attr_names) Instance Public methods Validates whether the associated object or objects are all valid. Works with any kind of association. class Book < ActiveRecord::Base has_many :pages belongs_to :library validates_associated :pages, :library end WARNING: This validation must not be used on both ends of an association. Doing so will lead to a circular dependency and cause infinite recursion. NOTE: This validation will not fail if the association ha
Page 2164 of 11844