Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:46:57+00:00 2026-05-24T23:46:57+00:00

before_* callbacks can halt execution by returning false. I have 3 before_destroy callbacks on

  • 0

before_* callbacks can halt execution by returning false.

I have 3 before_destroy callbacks on a model to halt destruction for several possible reasons. I’d like to tell the user which reason it is, but I’ll I get back from the model.destroy is false. How can I send a message out of the model, or determine from the controller which before_destroy callback halted execution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:46:58+00:00Added an answer on May 24, 2026 at 11:46 pm

    This is a nice question. I don’t know if there is a good way to do it. The only thing that comes to my mind is using errors[:base] but it sounds a bit of a hack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to chain metaclasses? I have class Model which uses __metaclass__=ModelBase to
Before, I have found the Cost in the execution plan to be a good
How can one enforce an order of callbacks? For example, how do you ensure
In Rails, blocks can be used as callbacks , e.g.: class User < ActiveRecord::Base
I have a activerecord model called game with an paperclip attachment called image. I
I am writing a small module which will have several different aspects to it,
I have a model that relies on state_machine to manage its different states. One
I have a event model that has many invitations. Invitations are setup through checkboxes
I can't get before & after callbacks to work with the cycle plugin for
I have a very tough problem I can't solve. I have an app which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.