material 0.3.9 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d972ea75601e360fcd9deb6d09e77a0fadda33bc636a4374ff3491a7a47bd03
4
- data.tar.gz: 3511cb81aa6c1a844b56c621e59b2b2be82dd373ef21e83af87644ff605aceaf
3
+ metadata.gz: 74d659b5ce62094b660fb044b328739bf1649063a995028f40ed2d6afc8bdf7c
4
+ data.tar.gz: bc2c13187de339827dedb67bfa038c52b723b8696dfdfe29f1c68bf91d242f1a
5
5
  SHA512:
6
- metadata.gz: 9a36fe4bae755b85dbd7a256da96538018cab21e4a7318b55a13d029ac7c84ce3fedcfc528aea94aabe6ef675605ec6588e35daa867dc0b9d0d885255cf3f772
7
- data.tar.gz: 3aec2f98cef993c11d93316ec54e4894336e30a2dc6c19193b791b44a9d9a73a4e6355138cae5f9bcaf6c7315eefb772d569b99bacc0ee131f036780609f0ece
6
+ metadata.gz: f39c7c0b7b7aca6f628fa455b5bf14bc2dec6dc19709779d107387538187e57d34be8c228ee59235d861866535c2738d2689d1457d6b6e7363e094370c800979
7
+ data.tar.gz: e0148847feb9812a2e09eb34bd4051fa02768e17a52678a7a7a6d9b4777b957cab44a8e299dab3ed5ed5cf15a5557afbea2958b83767d58bb1b4c18b3e23a4d6
@@ -29,7 +29,7 @@ module Material
29
29
  end
30
30
 
31
31
  def display_attributes
32
- attribute_names
32
+ (attribute_names + relationship_attributes).uniq
33
33
  end
34
34
 
35
35
  def attribute_values
@@ -42,6 +42,7 @@ module Material
42
42
 
43
43
  def formatted_attributes
44
44
  attribute_types.each_with_object({}) do |(attribute, attribute_type), hash|
45
+ next if relationship_attributes.include?(attribute)
45
46
  hash[attribute] = format_by_type(attribute_values[attribute], type: attribute_type)
46
47
  end
47
48
  end
@@ -55,7 +56,7 @@ module Material
55
56
  end
56
57
 
57
58
  def relationship_attributes
58
- source_class.reflect_on_all_associations.map(&:foreign_key)
59
+ source_class.reflect_on_all_associations.map(&:name).map(&:to_s)
59
60
  end
60
61
  end
61
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Material
4
- VERSION = "0.3.9"
4
+ VERSION = "0.3.11"
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
8
  - Brandon Trumpold
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-22 00:00:00.000000000 Z
12
+ date: 2025-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -214,7 +214,7 @@ homepage: https://github.com/Freshly/material
214
214
  licenses:
215
215
  - MIT
216
216
  metadata: {}
217
- post_install_message:
217
+ post_install_message:
218
218
  rdoc_options: []
219
219
  require_paths:
220
220
  - lib
@@ -229,9 +229,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubyforge_project:
233
- rubygems_version: 2.7.6
234
- signing_key:
232
+ rubygems_version: 3.5.9
233
+ signing_key:
235
234
  specification_version: 4
236
235
  summary: Wrap your records with a presentation layer without cannibalizing view responsibility.
237
236
  test_files: []