Maybe a stupid question but is it possible to use Symbol to_proc even for methods which need an argument?
Nope, it only works on very simple method calls which don't take an argument. Anything more complicated and you will need to use the full block.
Ryan,
Can more than one attribute be combined / concatenated ?
e.g. :
Something like ... (this doesn't work) :
ActorNames = Actor.find(:all).collect(&:last_name + ' ' + &:first_name)
.. neither does :
ActorNames = Actor.find(:all).collect(&:last_name,&:first_name)
Mike
@Mike, nope, you can only call a single method with Symbol to_proc. If you want to combine two methods like you're trying to do, I recommend creating a new "full_name" method in the actor model to do this. That way you're back to calling one method.
Before your readers subscribe to this method, they should be aware of the performance issue.
http://m.onkey.org/2007/6/30/let-s-start-with-wtf
Apparently, nothing beats a good olf-fashioned block
By virtue of my free epoche with respect to the being of the experienced world, the momentous fact is that we must not let ourselves be frightened by considerations of the ego cogito and cogitationes.




