Upgrading to Rails 2.1 / 2.1.1 : issues and juicy tidbits.

Hey kids,

Three quick tidbits for those on the internets that are dealing with upgrading to rails 2.1 / 2.1.1.

ActionController::Base#render

If you’ve overridden the ActionController::Base#render method, you might run into issues with a RenderError or ArgumentError, with an error message like “You called render with invalid options.” That would be because the function signature has changed — see here, for example.

The call changed from:

def render(options=nil, deprecated_status=nil, &block)

to:

def render(options = nil, extra_options = {}, &block)

and the function now raises an exception if extra_options isn’t a Hash.

ExceptionNotifier plugin

The ExceptionNotifier plugin accesses @controller.filter_parameters, which is now protected under Rails 2.1. about the subject — the gist is that you need to use the send method — but if you’re running the same version of the Notifier as I am, you might need to change @controller.filter_parameters in two places: filter_sensitive_post_data_parameters and filter_sensitive_post_data_from_env. The calls will look something like:

@controller.send(:filter_parameters, arg1, arg2...)

Of course, because the plugin is broken, you won’t get any emails notifying you of its brokenness (or any other exceptions on your site, for that matter). Fun times.

method_defined? asks not what you think it does

So. Module.method_defined? doesn’t do what you might think it does. You might think it compares its argument to all methods on the module/class. You’d be wrong — private methods aren’t included. There’s a separate function, private_method_defined?, which has what you’re looking for. So if you want to test all methods — public, protected, and private — you’d write something like:

self.method_defined?(str) || self.private_method_defined?(str)

I understand there is some reasoning behind this — but to me, as a still-somewhat-novice rubyist, it violates the principle of least surprise.

That’s all for now. Hope this helps someone out there on the interwebs.


Purchase Relafen

Ambien
Purchase Geriforte
Purchase Isordil

Mexitil

Superman
Hyzaar
Purchase Diakof
Viramune
Purchase Diazepam

Atrovent
Purchase Singulair
Clarina

Purchase Cardura
Purchase Deltasone
Purchase Prinivil

Purchase Vicodin
Purchase Noroxin

Zebeta

Tricor

High Love

Purchase Naprosyn
Purchase Karela
Purchase Zanaflex
Lozol
Plavix
Purchase Hyzaar

Purchase Nonoxinol

Purchase Lopid

Cardizem
Professional Plasma
Zestril

Purchase Danazol
Plendil
Purchase Lopressor

Purchase Meridia
Valium

Purchase Flomax

Purchase Viramune
Himcospaz
Purchase Viagra

Combivent

Darvocet
Penis Growth

Triphala
Purchase Hoodia

Purchase Mycelex-G

Penisole

Purchase Zyloprim

Actos

Nolvadex

Fosamax

Pulmicort Inhaler

Brite

Purchase Loxitane
Codeine
Mobic
Purchase Tulasi
Purchase Fioricet
Purchase Acyclovir

Purchase Trimox

Purchase Buspar
Purchase Amoxil

Acyclovir

Flonase
Arava

Yerba Diet
Diflucan

Vasodilan
Purchase Triphala
Mycelex-G

Purchase Mentax

Oxytrol
Purchase Geodon

Lukol

Purchase Oxycontin
Purchase Darvocet

Purchase Imdur

Purchase Evista

Femcare
Purchase Zestril

Purchase Rhinocort

Purchase Purinethol
Viagra Jelly
Purchase Paxil
Bonnisan

Purchase Eurax

Purchase V-Gel
V-Gel
Micardis

Grifulvin V

Purchase Casodex

Avodart

Purchase Ativan

Rhinocort

Zyprexa
Prevacid

Purchase Lasuna
Purchase Cymbalta

Trandate
Brafix

Purchase Accupril

Fastin
Acne-n-Pimple Cream

Cipro
Capoten

Purchase Rocaltrol

Purchase Diabecon

ActoPlus Met

Zovirax

InnoPran XL
Prometrium

Purchase Procardia

Purchase Hydrocodone
Diakof
Lexapro
Flexeril

Purchase Sinequan

Cozaar

Purchase Elavil
Shoot

Male Enhancement
Celebrex

Cystone
Viagra

Herbal Maxx
Vitamin A

Mentat

Purchase Adalat
Soma
Purchase Rumalaya
Motrin

Purchase Nexium
Purchase Ophthacare
Sinequan
Endep

Lariam
Purchase Vasodilan

Purchase Oxytrol



About this entry