diff options
author | eileencodes <eileencodes@gmail.com> | 2015-03-20 08:09:53 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2015-03-20 08:48:00 -0400 |
commit | 0755d300170d1ef2f6d78f76d0126e962167be5a (patch) | |
tree | db960004bab383536eb881c925df5ab014047b5c /railties/lib/rails/generators.rb | |
parent | 2753ffc63e70016f07b871c32c98f06dc35a781a (diff) | |
download | rails-0755d300170d1ef2f6d78f76d0126e962167be5a.tar.gz rails-0755d300170d1ef2f6d78f76d0126e962167be5a.tar.bz2 rails-0755d300170d1ef2f6d78f76d0126e962167be5a.zip |
Use fullpath from Rack request rather than building it
In Rack, `#fullpath` checks if there is a query string and builds the
query correctly:
```
def path
script_name + path_info
end
def fullpath
query_string.empty? ? path : "#{path}?#{query_string}"
end
```
We can utilize this instead of manually building the fullpath because
they are the same result. This also reduces allocations in `#call`
because we don't need `build_original_fullpath` to create the paths and
query strings. We don't need to build `fullpath` twice.
Diffstat (limited to 'railties/lib/rails/generators.rb')
0 files changed, 0 insertions, 0 deletions