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 6064153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:14:57+00:00 2026-05-23T09:14:57+00:00

My question is related to ROR, but in fact it’s rather about ruby syntax

  • 0

My question is related to ROR, but in fact it’s rather about ruby syntax I think.

In a model there is a built in method ‘save’, which saves the model to a database. I need to override the method, to do some additional job concerning files. I overloaded the method with a new one which takes 2 arguments. What I want to do now is to disable the original save method, so I don’t use it somewhere accidentally. For now I managed to do this by using alias_method. Now after calling save method with no arguments only prints a message to the console. The problem is this message probably will be overlooked.

What will be the best way to handle this?
Bye

  • 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-23T09:14:57+00:00Added an answer on May 23, 2026 at 9:14 am

    Your best option is to use the before_save and after_save callbacks in Ruby on Rails.

    You can read more about them here: http://guides.rubyonrails.org/active_record_validations_callbacks.html#callbacks-overview

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

Sidebar

Related Questions

A question related to Regular cast vs. static_cast vs. dynamic_cast : What cast syntax
My question related to the following 3 code excerpt: code of class method: start(options
i got a question related to the setMultiFile method of zend_form. I already got
Question related to HABTM has been posted in some good numbers on stackoverflow but
I asked a question related to this one previously but I need to know
I have a question related to trees. I have about 100 sentences on a
I have 2 question related to the web services. How we achieve the method
This is not a question related to a specific language, rather on the correct
I've a question related to some C# implementation on Model-View-Controller. I am fairly new
Question related to Lazarus or Delphi. Is there a way to programmatically access trusted

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.