Forum: Ruby on Rails Some of my code Broke after Upgrading from 0.13 to 0.14.3

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B614e42d18c609ac4585d0aa0b13d856?d=identicon&s=25 rails (Guest)
on 2005-11-12 12:49
(Received via mailing list)
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 :(  Any ideas?

Here is a condensed version of my model:
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-11-14 06:12
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 10, 2005, at 11:47 AM, Jim Jeffers 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-----
This topic is locked and can not be replied to.