Skip to content

Commit

Permalink
patch for subdomain constraints on rails 3.2 by jlfenaux
Browse files Browse the repository at this point in the history
  • Loading branch information
francesc committed Feb 24, 2012
1 parent cb6f512 commit b648f65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.rdoc
@@ -1,6 +1,6 @@
= rails-translate-routes

Rails 3.x routes translations based on Raul's translate_routes (https://github.com/raul/translate_routes).
Rails >=3.1 routes translations based on Raul's translate_routes (https://github.com/raul/translate_routes).

It's currently a stripped down version of the forked gem, adding some bugfixes for rails 3.1 and features I needed for my project. See doc below to see what it can do.

Expand Down Expand Up @@ -193,6 +193,7 @@ Thanks to:
* Martin Carel (https://github.com/cawel)
* Johan Gyllenspetz (https://github.com/gyllen)
* Nico Ritsche (https://github.com/ncri)
* Jean-Loup Fenaux (https://github.com/jlfenaux)

* Main development of forked gem:
* Raul Murciano (http://github.com/raul)
Expand Down
1 change: 1 addition & 0 deletions lib/rails-translate-routes.rb
Expand Up @@ -254,6 +254,7 @@ def translate_route route, locale
if Rails.version >= '3.2'
conditions = { :path_info => translate_path(route.path.spec.to_s, locale) }
conditions[:request_method] = parse_request_methods route.verb if route.verb != //
conditions[:subdomain] = route.constraints[:subdomain] if route.constraints
defaults = route.defaults.merge LOCALE_PARAM_KEY => locale.dup
else
conditions = { :path_info => translate_path(route.path, locale) }
Expand Down

0 comments on commit b648f65

Please sign in to comment.