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

  • Home
  • SEARCH
  • 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 161711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:15:42+00:00 2026-05-11T11:15:42+00:00

So I have been pulling my hair out troubleshooting this bug I have been

  • 0

So I have been pulling my hair out troubleshooting this bug I have been having, and I finally discovered what was causing it. I had always been under the impression that when I called

@my_model.save(false) 

That I would be skipping my ActiveRecord validations. Turns out this is partially true. My objects are saving to the database DESPITE my ActiveRecord validation. My problem exists because one of my validations modifies one of the children models during the validation process (This is a scheduling application for a 24 hours location, therefore when lunches are saved, I check them against the day they are saving, AND the next day as well to make sure the user didn’t mean ‘2am’ for an overnight shift.

My Question is this: Is there a way to actually skip my validations and move straight to the database? Is this normal ActiveRecord behavior or should I be diving deeper into my validations? Or am I out of luck and need to re-write my validations?

  • 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. 2026-05-11T11:15:42+00:00Added an answer on May 11, 2026 at 11:15 am

    You may want to use before_create or another callback to interact with the record prior to saving it to the database rather than trying to do this inside of a validator.

    Here is the documentation on ActiveRecord callbacks: http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html

    There is also a guide on using callbacks with some details on how to skip them here: http://guides.rubyonrails.org/activerecord_validations_callbacks.html

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

Sidebar

Related Questions

I have been having this problem and been pulling my hair out over it.
I have been pulling my hair out about this since Friday and I am
I have been pulling my hair out trying to make this work. I have
I have been pulling my hair trying to figure this out but nothing is
I've been pulling out my hair trying to figure this problem out. I have
been pulling my hair out over this for the past few hours. i have
I have been pulling my hair out trying to solve this. What I am
I have been pulling my hair out because of this. My cucumber step clicks
I have been pulling my hair out because of this 1 line of code.
I've been pulling my hair out on this one all afternoon. Basically, I have

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.