You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of #handle_archival_action_exception translates all exceptions to an ActiveRecord::Rollback exception. If archiving fails because of an exception, the only information return is 'false'. There are some log lines in that method that look like they intend to provide more information, but those log messages were not added to the test log in a recent Rails 7 project.
I think this situation can be replicated by making a model with a bogus relationship, like
class Foo < ApplicationRecord
acts_as_archival
has_many :bar
end
where the project does not have a Bar model. So, calling archive on an instance of Foo like
test = Foo.first
test.archive! #=> false
Debugging in the run_callbacks will show the failure is about failing to find the Bar class.
The text was updated successfully, but these errors were encountered:
The current implementation of #handle_archival_action_exception translates all exceptions to an ActiveRecord::Rollback exception. If archiving fails because of an exception, the only information return is 'false'. There are some log lines in that method that look like they intend to provide more information, but those log messages were not added to the test log in a recent Rails 7 project.
I think this situation can be replicated by making a model with a bogus relationship, like
where the project does not have a Bar model. So, calling archive on an instance of Foo like
Debugging in the
run_callbacks
will show the failure is about failing to find the Bar class.The text was updated successfully, but these errors were encountered: