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.
Ambien
Purchase Geriforte
Purchase Isordil
Superman
Hyzaar
Purchase Diakof
Viramune
Purchase Diazepam
Atrovent
Purchase Singulair
Clarina
Purchase Cardura
Purchase Deltasone
Purchase Prinivil
Purchase Vicodin
Purchase Noroxin
Purchase Naprosyn
Purchase Karela
Purchase Zanaflex
Lozol
Plavix
Purchase Hyzaar
Cardizem
Professional Plasma
Zestril
Purchase Danazol
Plendil
Purchase Lopressor
Purchase Viramune
Himcospaz
Purchase Viagra
Purchase Loxitane
Codeine
Mobic
Purchase Tulasi
Purchase Fioricet
Purchase Acyclovir
Purchase Buspar
Purchase Amoxil
Vasodilan
Purchase Triphala
Mycelex-G
Purchase Oxycontin
Purchase Darvocet
Purchase Purinethol
Viagra Jelly
Purchase Paxil
Bonnisan
Purchase Lasuna
Purchase Cymbalta
Purchase Hydrocodone
Diakof
Lexapro
Flexeril
Purchase Adalat
Soma
Purchase Rumalaya
Motrin
Purchase Nexium
Purchase Ophthacare
Sinequan
Endep
About this entry
You’re currently reading “ Upgrading to Rails 2.1 / 2.1.1 : issues and juicy tidbits. ,” an entry on light in august
- Published:
- 1.2.08 / 12am
- Category:
- Uncategorized
No comments
Jump to comment form | comments rss [?] | trackback uri [?]