Remove AV::Resolver/PathSet/LookupContext#find_all methods

16 views
Skip to first unread message

thedarkone

unread,
Jul 3, 2012, 4:51:22 PM7/3/12
to rubyonra...@googlegroups.com

There is not a single line of code in all of Rails that makes use of the `.find_all` template API, that doesn't look like this: `lookup.find_all(*args).first`. Getting rid of the unnecessary Array handling would simplify the implementation.

Therefore I would like to propose to deprecate and remove the `AV::Resolver#find_all/find_templates`, `AV::PathSet#find_all` and `LookupContext#find_all` methods and replace them with `AV::Resolver#find/find_template`, `AV::PathSet#find/find_if_exists` and `LookupContext#find/find_if_exists`. Some of the classes already provide the `#find` methods so that would be mostly about replacing `lookup.find_all(*args).first` with `lookup.find_if_exists(*args)`.

Would be willing to provide a patch.

/cc @josevalim.

José Valim

unread,
Jul 7, 2012, 9:44:43 AM7/7/12
to rubyonra...@googlegroups.com
I believe Action Mailer uses all templates returned by find_all. I'm on iPhone so I am not sure, but it should be aroun the each_template method .
Reply all
Reply to author
Forward
0 new messages