enriclluelles/route_translator — pull request #80 by tagliala (2014-12-10 21:58:48+00:00)
Title: Improved action controller

Based on how `I18n.with_locale` is implemented (https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L252) I tried to improve the action controller.

I aimed to avoid unnecessary function calls to `I18n.with_locale` and `self.with_host_locale`, assignments and nested block call. Moreover, the new approach [should be faster](https://speakerdeck.com/sferik/writing-fast-ruby?slide=12) but I'm very new to profiling so maybe you are interested in writing proper performance tests

Beside gem's own tests, I launched some of my applications specs:
```
Using route_translator 3.2.4 from source at ~/dev/route_translator

Finished in 2 minutes 36.1 seconds (files took 11.93 seconds to load)
317 examples, 0 failures
```

```
Using route_translator 3.2.4 from source at ~/dev/route_translator

Finished in 4 minutes 10.2 seconds (files took 11.38 seconds to load)
409 examples, 0 failures
```

```
Using route_translator 3.2.4 from source at ~/dev/route_translator

Finished in 1 minute 11.67 seconds (files took 11.85 seconds to load)
188 examples, 0 failures, 1 pending
```