Question of style: Is it ok for a predicate method to change something when called? I'm in a new-to-me codebase and I'm trying to resist the urge to rename every method that ends in a ? but isn't idempotent
Hey all, I have an... interesting... problem and wonder if there's a way to make a Class do something (say, print to the console or log or whatever I have available) whenever a method is defined on it. Anyone know?
basically I'm inheriting a project where I've already found some metaprogramming crimes against nature and want to see where we're defining or redefining things
Hey. I've got a weird issue bringing a stone-age Rails 2 app into the Rails 3 bronze (iron?) age... basically, I have a layout defined in a controller, but the action I'm hitting isn't rendering with that layout unless I explicitly do 'render layout: "my_layout"' at the end of the action. Has anyone seen anything like this?
pretty sure the person who started this process did that already, we have new routes etc, app configs etc.
BraddBitt: so... this is an ugly hack I did, and works with Rails.logger and not the native one, but a similar pattern might do what you want... https://github.com/babney/log_raider/blob/master/lib/log_raider.rb
this was intended to log errors to Rails.logger and also send them to NewRelic... like I said, similar pattern