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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:39:18+00:00 2026-06-12T14:39:18+00:00

we are upgrading from rails 2.3 to rails 3 and we have some validation

  • 0

we are upgrading from rails 2.3 to rails 3 and we have some validation on a model like:

validates_length_of :corporate_type,  :in => 1..255, :allow_blank => false, :on => :update, :if => Proc.new { |rra| rra.show_corporate_type? }

In rails 2.3 this only gets called on update, but in rails 3, it seems to be called on create, which breaks some stuff downstream… Can someone explain why this is getting called on create?

Here is the stack:

app/models/rra_agreement.rb:11:in `block in <class:RRAAgreement>'

app/models/foo_application_delegate.rb:29:in `create_application'

Line 28 and 29 are:

rra = RRAAgreement.new()
rra.save

line 11 is the validation line above

thanks
Joel

  • 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-06-12T14:39:19+00:00Added an answer on June 12, 2026 at 2:39 pm

    The syntax is changed for rails 3, try this to call only on update,

    validates :corporate_type,:length => {:on => :update, :min => 1, :max => 20 } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some issues with routing when upgrading rails from 3.2.0 to 3.2.2. When
I have a hairy set of routes that I'm upgrading from Rails 2 to
I have some troubles with testing in Rails 3. I'm currently upgrading a Rails2
I'm upgrading an app to Rails 3. We have an Application Controller like the
I set myself the task of upgrading my app from rails 3.1 to rails
Upgrading from ASP.NET WebAPI Beta to RC has provided some amount of excitement and
We are currently evaluating upgrading from XP to Windows 7, but have one last
How hard/complex would upgrading an application from Rails 2.2.2 to the latest build? I
We are currently in the process of upgrading our rails version and I have
Some time ago I updated my app from Rails 1.2 to 2.3. The upgrade

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.