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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac975b81fe34e00d8c02a575c79403bec5ab71c5aa5e597ce53932bc47306563
4
- data.tar.gz: ae781ae8cc74315609e8d0d361b73a9f67993c881f72a24a910baac6e02681db
3
+ metadata.gz: d4663eac4c4bf9508337989e4a4d872cb638521158790a22806777e849ea682a
4
+ data.tar.gz: da62b4b959de218bcd28b464c1c748a9c60b4ff721c07ac94c959659ad2d42bf
5
5
  SHA512:
6
- metadata.gz: d926b7e1c2c91a41428c6459d4597159c066b136ac44851c37d2f9689485fcac1cdd6df9bcf164b2d72e8cde2018f6b87789201b69241e6beba30c1827bd2614
7
- data.tar.gz: e949c53ddc47ba83606be1c840825dcaa3d73eec6570cb970abc12fdeec2759e52a4ac26da979e717c3d34b6764b025a8e83930bd032fb5276213b2ba64c6f50
6
+ metadata.gz: eeca72e2a8bace8b181258eac6e7ed73805a63ca67457f97ca0c758363ec235926c343aa99d3860c071b88a11b3f5be1a40652f98648b0b2ba056a7171bdb0c4
7
+ data.tar.gz: 5bc60c368d47fb2e3870d4ce31b7dbee282c0eb0a3e768123f988edbbe9dc7af46f5668e6d28f0e579dff99abb01add320ab1c3e4e1cb9639b1e105b20898946
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # InferredCrumpets
2
2
 
3
+ ## 0.4.1
4
+
5
+ * [TT-5835] Fix crumb title for active record relation
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  * [TT-5807] Use crumb title for the subject name
@@ -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 subject_name.pluralize.titleize
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
@@ -1,3 +1,3 @@
1
1
  module InferredCrumpets
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.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.4.0
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-05 00:00:00.000000000 Z
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails