role_based_authorization 0.1.9 → 0.1.10

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.1.10
@@ -197,11 +197,14 @@ module RoleBasedAuthorization
197
197
  # if_authorized?( edit_item_path ) { |opts| link_to('yyy', opts) }
198
198
 
199
199
  def if_authorized? opts, &block
200
+ cleanup_url_regexp = %r{(\Ahttps?://[^/]*(#{ActionController::Base.relative_url_root})?)}
201
+
200
202
  url_options = nil
201
203
  if opts.class == String
202
204
  path = opts
203
205
 
204
- url_options = ActionController::Routing::Routes.recognize_path(path)
206
+
207
+ url_options = ActionController::Routing::Routes.recognize_path(path.gsub(cleanup_url_regexp,''))
205
208
  else
206
209
  url_options = opts.dup
207
210
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{role_based_authorization}
8
- s.version = "0.1.9"
8
+ s.version = "0.1.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roberto Esposito"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: role_based_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Esposito