sidenotes 0.1.0 → 0.1.2

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: 3d148544eafc19e2884ef9cd774c8d65c09ba29c6bce5a2cfaf1c139dc6eee4b
4
- data.tar.gz: 583fd447f4e4469d32ab5179190a4be72d6f57a990379ef504b81462907b9061
3
+ metadata.gz: b8ae9eac3b04b22f97ed8449628befa33a88bfa94ac1e3533a62290ffffb1a32
4
+ data.tar.gz: 81616ba19442a2b9dbae04a494d092cd93f998aaf5fb2a105f75a0fbfb059b16
5
5
  SHA512:
6
- metadata.gz: fb0d4ad4bbc6faf74a9cc2097d777f2b0e41ba03b2843eb266bc709c1c14f9dba62d5d9017147aa6b9b1c96fcb5be17f98b810f3522bda98abd05dd0d95c92c4
7
- data.tar.gz: ef5bebedb9a3536e92729859d7fb65778540c27813fc8b071f0a20ba6f030e3d25c835556a54c82b48696521c3090416a704e15a914e43e6e9132c4f4b1c9bb2
6
+ metadata.gz: 668ef3a9a5bbdb367fce80df121953c503f8ac4f948ba246eb1cf297ad620adba89e8e9e97a9a4bf8bb8d518f052fd4a6cbb79090099a1e8541f2ab19cce6a14
7
+ data.tar.gz: 5bad7f9f8f5f6673938f93e85711d7782b0abe180c49e4f7ba3d14047f729bd868b7e095ee1263c663d83ff728d6eed0f936b933cefd1ea03145c1bcf58f6ebb
data/README.md CHANGED
@@ -186,7 +186,7 @@ The structured YAML/JSON format makes it straightforward to build integrations f
186
186
  ## Requirements
187
187
 
188
188
  - Ruby >= 3.1
189
- - Rails >= 6.1
189
+ - Rails >= 6.0
190
190
 
191
191
  ## Development
192
192
 
@@ -70,20 +70,9 @@ module Sidenotes
70
70
  end
71
71
 
72
72
  def load_model_files
73
- return if defined?(Rails) && Rails.application&.config&.eager_load
73
+ return unless defined?(Rails) && Rails.application
74
74
 
75
- model_file_paths.each do |file|
76
- require file
77
- rescue LoadError, NameError => e
78
- warn "Sidenotes: could not load #{file}: #{e.message}"
79
- end
80
- end
81
-
82
- def model_file_paths
83
- Sidenotes.configuration.model_paths.flat_map do |path|
84
- full_path = defined?(Rails) ? Rails.root.join(path) : Pathname.new(path)
85
- Dir.glob(full_path.join('**', '*.rb'))
86
- end
75
+ Rails.application.eager_load!
87
76
  end
88
77
 
89
78
  def collect_models
@@ -108,7 +108,7 @@ module Sidenotes
108
108
  end
109
109
 
110
110
  def associations
111
- model.reflect_on_all_associations.map { |assoc| build_association_data(assoc) }
111
+ model.reflect_on_all_associations.filter_map { |assoc| build_association_data(assoc) }
112
112
  end
113
113
 
114
114
  def build_association_data(assoc)
@@ -119,6 +119,8 @@ module Sidenotes
119
119
  data['polymorphic'] = true if opts[:polymorphic]
120
120
  data['through'] = opts[:through].to_s if opts[:through]
121
121
  data
122
+ rescue NoMethodError
123
+ nil
122
124
  end
123
125
 
124
126
  def foreign_keys
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidenotes
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidenotes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wes Mason
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.1'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '6.1'
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '6.1'
33
+ version: '6.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '6.1'
40
+ version: '6.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '6.1'
47
+ version: '6.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '6.1'
54
+ version: '6.0'
55
55
  description: Generates structured schema annotation files for Rails models as gitignored
56
56
  sidecar files, replacing inline comments with separate metadata files that IDEs
57
57
  and tools can consume.