eac_rails_base0 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87e96f80ef9df442af3f9df81ed228eb1e4f5c2df84e971ae69762ba18f06e10
4
- data.tar.gz: 70e30a24e467f531ac29701f8f9d7cb551edda054de4a47ba3d755b1d75d3972
3
+ metadata.gz: 61de5368e79c0b904b83f5b55905d0e94ff98399cc85bcb0794b2397aef7638d
4
+ data.tar.gz: c78e218f39fa33d7de14ef012b4dc2531565eea46083aad83bf5207e4ae5b9b5
5
5
  SHA512:
6
- metadata.gz: f2a58774f2214839ff74cdc909dd57ed311a9dc48f3c3bf52a81d4b6b2b8b1208575eb1cade5a9ca99d67efb5edea733fc9d87106cb0347c03a3aa67f9029c21
7
- data.tar.gz: 36cc128968473ba0e835e4a9b7c0bd45cb7bc034f362765348f506df969bc4580c519d5662378214c623a8256cab3add35eb26c09d3f04b09bb3809ca4c59e1b
6
+ metadata.gz: 8a6b8f468093d3fc72eea043ffb1d7e9f647be9b2cfa008a638e88c7b5952903f2bbc185cd701c718a1e315071fe2d233dd3c3b369eccf8eb3a19396270411ac
7
+ data.tar.gz: 9df63e9f26ef72c82d73fab21e4fc5dafe9d701662b0d17f5aa82b09f018b4418771852ca14dd40c093e4d11c08f585dfba619f79c17d2ba00901f1136e93bb2
@@ -16,3 +16,4 @@ end
16
16
 
17
17
  require_dependency 'eac_rails_base0/app_base/ability_mapping'
18
18
  require_dependency 'eac_rails_base0/app_base/ability'
19
+ require_dependency 'eac_rails_base0/patches/url_for_patch'
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsBase0
4
+ module Patches
5
+ module UrlForPatch
6
+ class << self
7
+ def included(base)
8
+ base.include(InstanceMethods)
9
+ base.alias_method_chain :url_for, :engines
10
+ end
11
+ end
12
+
13
+ module InstanceMethods
14
+ def url_for_with_engines(options = nil)
15
+ url_for_without_engines(options)
16
+ rescue ActionController::UrlGenerationError
17
+ engines_url_for(options)
18
+ end
19
+
20
+ private
21
+
22
+ def engines_url_for(options)
23
+ ::Rails::Engine.subclasses.each do |engine|
24
+ url = engine_url_for(engine, options)
25
+ return url if url
26
+ end
27
+ raise ActionController::UrlGenerationError, "Options: #{options}"
28
+ end
29
+
30
+ def engine_url_for(engine, options)
31
+ engine.routes.url_for(options)
32
+ rescue ActionController::UrlGenerationError
33
+ nil
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ patch = ::EacRailsBase0::Patches::UrlForPatch
41
+ target = ::ActionDispatch::Routing::UrlFor
42
+ target.send(:include, patch) unless target.included_modules.include?(patch)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.12.0'
4
+ VERSION = '0.13.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-27 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.3'
53
+ version: '0.4'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.3'
60
+ version: '0.4'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: byebug
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -414,6 +414,7 @@ files:
414
414
  - lib/eac_rails_base0/app_generator/templates/config/routes.rb
415
415
  - lib/eac_rails_base0/app_generator/templates/lib/local_plugins.rb
416
416
  - lib/eac_rails_base0/engine.rb
417
+ - lib/eac_rails_base0/patches/url_for_patch.rb
417
418
  - lib/eac_rails_base0/spec_helper.rb
418
419
  - lib/eac_rails_base0/spec_helper/capybara.rb
419
420
  - lib/eac_rails_base0/spec_helper/eac_users_support.rb