Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent documentation between ActiveRecord::RecordNotSaved and ActiveRecord::Persistence::ClassMethods#save! #51672

Closed
fffx opened this issue Apr 26, 2024 · 0 comments

Comments

@fffx
Copy link
Contributor

fffx commented Apr 26, 2024

In ActiveRecord::Persistence::ClassMethods#save! :

 # There's a series of callbacks associated with #save!. If any of
 # the <tt>before_*</tt> callbacks throws +:abort+ the action is cancelled
 # and #save! raises ActiveRecord::RecordNotSaved. See
 # ActiveRecord::Callbacks for further details.

But in ActiveRecord::RecordNotSaved:

 # Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and
 # {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!]
 # methods when a record is invalid and cannot be saved.

The doc in ActiveRecord::RecordNotSaved is not accurate, should we update the doc in ActiveRecord::RecordNotSaved to this?

 # Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and
 # {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!]
 # If any of the <tt>before_*</tt> callbacks throws +:abort+ , See
 # ActiveRecord::Callbacks for further details.
@fffx fffx changed the title Inconsistent documentation between ActiveRecord::RecordNotSaved and ActiveRecord::RecordNotSaved Inconsistent documentation between ActiveRecord::RecordNotSaved and ActiveRecord::Persistence::ClassMethods#save! Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant