mbleigh-subdomain-fu 0.0.3 → 0.0.4

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.
@@ -31,4 +31,9 @@ end
31
31
 
32
32
  ActionController::Routing::RouteSet.send :include, SubdomainFu::RouteSetExtensions
33
33
  ActionController::Routing::Route.send :include, SubdomainFu::RouteExtensions
34
- ActionController::UrlRewriter::RESERVED_OPTIONS << :subdomain
34
+
35
+ # UrlRewriter::RESERVED_OPTIONS is only available in Rails >= 2.2
36
+ # http://www.portallabs.com/blog/2008/12/02/fixing-subdomain_fu-with-named-routes-rails-22/
37
+ if Rails::VERSION::MAJOR >= 2 and Rails::VERSION::MINOR >= 2
38
+ ActionController::UrlRewriter::RESERVED_OPTIONS << :subdomain
39
+ end
@@ -27,18 +27,20 @@ module ActionController
27
27
  alias_method_chain :rewrite_url, :subdomains
28
28
  end
29
29
 
30
- # hack for http://www.portallabs.com/blog/?p=8
31
- module Routing
32
- module Optimisation
33
- class PositionalArgumentsWithAdditionalParams
34
- def guard_condition_with_subdomains
35
- # don't allow optimisation if a subdomain is present - fixes a problem
36
- # with the subdomain appearing in the query instead of being rewritten
37
- # see http://mbleigh.lighthouseapp.com/projects/13148/tickets/8-improper-generated-urls-with-named-routes-for-a-singular-resource
38
- guard_condition_without_subdomains + " && !args.last.has_key?(:subdomain)"
39
- end
30
+ if Rails::VERSION::MAJOR >= 2 and Rails::VERSION::MINOR <= 1
31
+ # hack for http://www.portallabs.com/blog/2008/10/22/fixing-subdomain_fu-with-named-routes/
32
+ module Routing
33
+ module Optimisation
34
+ class PositionalArgumentsWithAdditionalParams
35
+ def guard_condition_with_subdomains
36
+ # don't allow optimisation if a subdomain is present - fixes a problem
37
+ # with the subdomain appearing in the query instead of being rewritten
38
+ # see http://mbleigh.lighthouseapp.com/projects/13148/tickets/8-improper-generated-urls-with-named-routes-for-a-singular-resource
39
+ guard_condition_without_subdomains + " && !args.last.has_key?(:subdomain)"
40
+ end
40
41
 
41
- alias_method_chain :guard_condition, :subdomains
42
+ alias_method_chain :guard_condition, :subdomains
43
+ end
42
44
  end
43
45
  end
44
46
  end
data/subdomain-fu.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "subdomain-fu"
3
- s.version = "0.0.3"
3
+ s.version = "0.0.4"
4
4
  s.date = "2008-06-25"
5
5
  s.summary = "Provides a simple solution for route handling and linking between subdomains in a Rails application."
6
6
  s.email = "michael@intridea.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbleigh-subdomain-fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh