subdomain_locale 1.0.beta4 → 1.0.beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/subdomain_locale/url_for.rb +2 -2
- data/subdomain_locale.gemspec +1 -1
- data/test/dummy/app/views/hello/world.html.erb +1 -0
- data/test/rails_test.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 749e76f7ece9b06223186583b7d207e557b37a40
|
4
|
+
data.tar.gz: 1b9cc4610f7e450943c8a06179855241a0cd0476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bab89ac779f0173ef5e41eb3ad49210cd849799fc72ace8a02bfa055f51148e1b06a175187773e28d6737c87a3047de69953f916b91ffadd5f81a24efa53f0c
|
7
|
+
data.tar.gz: 63c464a9cc6e82aa08892a4b7feba3535d046d6f8b8035d26e9bd5248cf9c6e6d289a97323a7de3b43ac74abf749b88fce8882df2b555a0502d65ff1b7cd2cdc
|
@@ -10,12 +10,12 @@ module SubdomainLocale
|
|
10
10
|
def url_for(options=nil)
|
11
11
|
if options.is_a?(Hash)
|
12
12
|
options = options.dup
|
13
|
-
if options.
|
13
|
+
if options.key?(:locale)
|
14
14
|
# Locale specified, force full URL
|
15
15
|
locale = options.delete(:locale)
|
16
16
|
options[:subdomain] = subdomain_locales.subdomain_for(locale)
|
17
17
|
options[:only_path] = false
|
18
|
-
elsif options.
|
18
|
+
elsif options.key?(:only_path) && !options[:only_path] && !options.key?(:subdomain)
|
19
19
|
# Requested full URL, use current locale
|
20
20
|
options[:subdomain] = subdomain_locales.subdomain_for(current_locale)
|
21
21
|
end
|
data/subdomain_locale.gemspec
CHANGED
data/test/rails_test.rb
CHANGED
@@ -10,6 +10,7 @@ class HelloControllerTest < ActionController::TestCase
|
|
10
10
|
assert_equal "http://example.com/", menu[1]["href"]
|
11
11
|
assert_equal "http://ru.example.com/", menu[2]["href"]
|
12
12
|
assert_equal "http://ua.example.com/", menu[3]["href"]
|
13
|
+
assert_equal "http://beta.example.com/", menu[4]["href"]
|
13
14
|
end
|
14
15
|
|
15
16
|
def test_default
|