diff options
author | Timo Schilling <timo@schilling.io> | 2014-12-16 11:30:24 +0100 |
---|---|---|
committer | Timo Schilling <timo@schilling.io> | 2014-12-16 11:37:04 +0100 |
commit | e1fb3483d6402bd66c41a12d158fd1c987fac983 (patch) | |
tree | 0b866c170acfb07f15870f28e81a8f304e0f042c /actionpack/test/dispatch/middleware_stack | |
parent | 41dc7fd650b0fcaf8f05f895aab13febac0739ec (diff) | |
download | rails-e1fb3483d6402bd66c41a12d158fd1c987fac983.tar.gz rails-e1fb3483d6402bd66c41a12d158fd1c987fac983.tar.bz2 rails-e1fb3483d6402bd66c41a12d158fd1c987fac983.zip |
allow reseting of request variants
The current implementation of `variants=` don't allow a resetting to nil, wich is the default value.
This results in the following code smell:
```ruby
case request.user_agent
when /iPhone/
request.variants = :phone
when /iPad/
request.variants = :ipad
end
```
With the ability to reset variants to nil, it could be:
```ruby
request.variants = case request.user_agent
when /iPhone/
:phone
when /iPad/
:ipad
end
```
Diffstat (limited to 'actionpack/test/dispatch/middleware_stack')
0 files changed, 0 insertions, 0 deletions