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

Question related to HABTM has been posted in some good numbers on stackoverflow but
A question related to Regular cast vs. static_cast vs. dynamic_cast : What cast syntax
I am really really new to Ruby On Rails, so I think it is
Question related to PHP memory-handling from someone not yet very experienced in PHP: If
Another question related to this one . I have a List<SortableObjects> that is the
(First question related to iPhone development, so apologies for sounding off-track.) I'm creating a
I am working in asp.net MVC2 application and I have question related to design
I couldn't get the POST value in servlet page. my previous question related to
Related question: Any good reason why assignment operator isn't a sequence point? From the
In a related question we explored using ProcessBuilder to start external processes in low

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.