inferred_crumpets 0.2.0 → 0.2.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: 721a182a6b0d426b2ef9d043d8463a07d893aa0c
4
- data.tar.gz: 6b28fbdeb2a8db15ca0b881738e02b8282be6651
3
+ metadata.gz: 65e934c11162bd51c3cacc6e79ad454c9c99cb6b
4
+ data.tar.gz: 62806af65991fd0172d9d525f39713b67516917d
5
5
  SHA512:
6
- metadata.gz: 4d381a2f21bfdf5c2131dc3ce155ee3b44464cbda59f197960416c3aeea4e096e5adc0043a2f4b4f5ebd7f7cf4409cd9a4c01bec378cf83a5bd9186ffde1e226
7
- data.tar.gz: 8a5817999bd0e1ac16371197697ab613a0c83293603ba4cfc592840ce1b22fe2d88c0a4c7393c6bb6fc99566016d85e8a3f677e85cd68adace027dca40e8be46
6
+ metadata.gz: 72d88d79cec9736d518534b2b1783e3494e99019bfb5d296bf7b1dc8872b24de48e6f9ad58c5a88de206ae99d90b42c351a2ef2e225c16a08f054dd1f01c2e03
7
+ data.tar.gz: fd0ab2ecc00af082336b3a132bdccbb5f758b46c9eb9ef18dd597f29f870fde4953b6665bab3148da1317e08473ea063a4f767c16e7e32ae328e85dbecf7d8b3
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # InferredCrumpets
2
2
 
3
+ ## 0.2.1
4
+
5
+ * [TT-2850] Fix: Don't link to actions that have no url
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  * Fix: shallow routes no longer cause a routing error
@@ -52,6 +52,7 @@ module InferredCrumpets
52
52
  end
53
53
 
54
54
  def build_crumb_for_action!
55
+ return unless linkable?
55
56
  return unless subject.is_a?(ActiveRecord::Base)
56
57
 
57
58
  if %w(new create).include?(action)
@@ -96,6 +97,12 @@ module InferredCrumpets
96
97
  false
97
98
  end
98
99
 
100
+ def linkable?
101
+ view_context.url_for(subject)
102
+ rescue NoMethodError
103
+ false
104
+ end
105
+
99
106
  def can_route?(action, params = {})
100
107
  view_context.url_for({
101
108
  action: action,
@@ -1,3 +1,3 @@
1
1
  module InferredCrumpets
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferred_crumpets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Colegate
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -89,6 +89,7 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
91
  - ".rspec"
92
+ - ".ruby-version"
92
93
  - ".travis.yml"
93
94
  - CHANGELOG.md
94
95
  - CODE_OF_CONDUCT.md
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  version: '0'
125
126
  requirements: []
126
127
  rubyforge_project:
127
- rubygems_version: 2.6.11
128
+ rubygems_version: 2.6.8
128
129
  signing_key:
129
130
  specification_version: 4
130
131
  summary: Automatic breadcrumbs for Rails.