Some of my code Broke after Upgrading from 0.13 to 0.14.3


#1

Some code has stopped working in my model as a result of upgrading to
rails rc4.

Two things stopped functioning properly in my model after my web-
hosts upgraded their rails environment:

  1. There is a small percentage of phone numbers that are making it
    past my before filter. They are coming through with dashes. i.e.
    ‘123-456-7890’ but when I attempt to recreate this the phone number
    is normalized fine. I’m unsure why 13 or 14 out of 116 new records
    would pass by the fillter some how?

  2. Prior to the upgrade I had redefined read attribute to format all
    of the attributes to uppercase (thanks to help from people on this
    list). But now this code is no longer working :frowning: Any ideas?

Here is a condensed version of my model:


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 10, 2005, at 11:47 AM, Jim J. wrote:

records would pass by the fillter some how?

Text transforms all strings to uppercase prior to display.

def read_attribute(attr_name)
a = super(attr_name)
if a.respond_to? ‘upcase’ then a.upcase else a end
end
end

Does your code work when you remove the read_attribute override?

Try setting ActiveRecord::Base.generate_read_methods = false in
environment.rb

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDeBwdAQHALep9HFYRAimzAJ9Sloh8c2S7b8Qs5V6zDVBI9Ot4dgCfXLOa
SsZM/r9/KOo5W/oEoCNxAdI=
=1FgX
-----END PGP SIGNATURE-----