para 0.8.0 → 0.8.1

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
  SHA1:
3
- metadata.gz: 47cd4fad8f6308c2c3ae1948bea744640d0ce772
4
- data.tar.gz: e6f7cf338d48a9ef60f696221413c263d34dcc10
3
+ metadata.gz: a1faf348515d9fd8b67b0d7f5622a0c20939dd67
4
+ data.tar.gz: 64ba7fd8be6fd5f0afc1a1f71c5f7bc7ef753ffa
5
5
  SHA512:
6
- metadata.gz: e38d091236ea396e0836560be1128c551393495ea6e967ee6a40f73ccfc301e1ded6e5682b5b23f65e1ae7406c8fc1e820d57a8c9edb3d53fc109735620b1960
7
- data.tar.gz: c31d521f7c6a38eadb0646ecdc48f23ca8e258c4b0b285c5b90301013175fde19792716654d7ceeca9180895853d7c4c237dc9c1a10e41d7d5202cad8fb33c41
6
+ metadata.gz: da890d70c6a6f205954003a65971aafd1dcc365c96658a18658b5b0422a6af83e69b10c6f9f79f8502d0a9104eff2e6eeb64299fedd0e906c1eacdff6e9c4afc
7
+ data.tar.gz: 8f8e638e0a9744381b5dafc6f7228b0fc31d4a094efd8e0d34432698b8a7df26dbd7a48a815fa98bc8986eb1d8217807abd0ba785a120df1719b2c8f584e0af5
@@ -8,13 +8,18 @@ module Para
8
8
  find_path([:admin, self, namespace].compact, options)
9
9
  end
10
10
 
11
- def relation_path(controller_or_resource, options = {})
11
+ def relation_path(controller_or_resource, *nested_resources, **options)
12
+ nested = nested_resources.any?
13
+
12
14
  if controller_or_resource.is_a?(Hash)
13
15
  options = controller_or_resource
14
16
  controller_or_resource = nil
15
17
  end
16
18
 
17
- components = [:admin, self, controller_or_resource].compact
19
+ controller_or_resource = nil if controller_or_resource.is_a?(ActiveRecord::Base)
20
+
21
+ options[:action] = action_option_for(options, nested: nested)
22
+ components = [:admin, self, controller_or_resource, *nested_resources].compact
18
23
 
19
24
  find_path(components, options)
20
25
  end
@@ -42,6 +47,14 @@ module Para
42
47
  rescue => exception
43
48
  exception
44
49
  end
50
+
51
+ def action_option_for(options, nested: false)
52
+ if !nested && options[:action].try(:to_sym) == :show
53
+ nil
54
+ else
55
+ options[:action]
56
+ end
57
+ end
45
58
  end
46
59
  end
47
60
  end
@@ -23,16 +23,6 @@ module Para
23
23
  def page_container_class
24
24
  history? ? 'col-md-8' : super
25
25
  end
26
-
27
- private
28
-
29
- def action_option_for(options, nested: false)
30
- if !nested && options[:action].try(:to_sym) == :show
31
- nil
32
- else
33
- options[:action]
34
- end
35
- end
36
26
  end
37
27
  end
38
28
  end
data/lib/para/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Para
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-01 00:00:00.000000000 Z
11
+ date: 2019-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails