inferred_crumpets 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/inferred_crumpets/builder.rb +5 -5
- data/lib/inferred_crumpets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4663eac4c4bf9508337989e4a4d872cb638521158790a22806777e849ea682a
|
4
|
+
data.tar.gz: da62b4b959de218bcd28b464c1c748a9c60b4ff721c07ac94c959659ad2d42bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeca72e2a8bace8b181258eac6e7ed73805a63ca67457f97ca0c758363ec235926c343aa99d3860c071b88a11b3f5be1a40652f98648b0b2ba056a7171bdb0c4
|
7
|
+
data.tar.gz: 5bc60c368d47fb2e3870d4ce31b7dbee282c0eb0a3e768123f988edbbe9dc7af46f5668e6d28f0e579dff99abb01add320ab1c3e4e1cb9639b1e105b20898946
|
data/CHANGELOG.md
CHANGED
@@ -46,7 +46,7 @@ module InferredCrumpets
|
|
46
46
|
return if parents.present? && linkable?
|
47
47
|
|
48
48
|
if subject.is_a?(ActiveRecord::Relation)
|
49
|
-
view_context.crumbs.add_crumb
|
49
|
+
view_context.crumbs.add_crumb relation_name.pluralize.titleize
|
50
50
|
elsif subject.is_a?(ActiveRecord::Base)
|
51
51
|
view_context.crumbs.add_crumb subject.class.table_name.titleize, url_for_collection
|
52
52
|
end
|
@@ -107,6 +107,10 @@ module InferredCrumpets
|
|
107
107
|
view_context.params[:action]
|
108
108
|
end
|
109
109
|
|
110
|
+
def relation_name
|
111
|
+
subject.respond_to?(:name) && subject.name.present? ? subject.name : subject.to_s
|
112
|
+
end
|
113
|
+
|
110
114
|
def subject_name
|
111
115
|
subject.respond_to?(:crumb_title) && subject.crumb_title.present? ? subject.crumb_title : subject.to_s
|
112
116
|
end
|
@@ -114,9 +118,5 @@ module InferredCrumpets
|
|
114
118
|
def class_with_parents
|
115
119
|
[parents.last, transformed_subject.class].compact
|
116
120
|
end
|
117
|
-
|
118
|
-
def inherited_resources?
|
119
|
-
defined?(InheritedResources) && view_context.controller.responder == InheritedResources::Responder
|
120
|
-
end
|
121
121
|
end
|
122
122
|
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.4.
|
4
|
+
version: 0.4.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: 2019-08-
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|