support_table_data 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/VERSION +1 -1
- data/lib/support_table_data.rb +5 -4
- data/support_table_data.gemspec +2 -0
- metadata +5 -5
- /data/{MIT-LICENSE → MIT-LICENSE.txt} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81f072d6a885460e7b162d811cd3e874438897beb6c5744f57d362d6cfdde132
|
4
|
+
data.tar.gz: 219596de9ad0a8e93c17b0a106d4c7eab21a201c4cbfec1c0e8115b432eb6202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5644a4dd6662cff7fe160155755b0b32e988d47f337dedaac9468aa583c8e24889cde8d7f6a57c542d0a57af6182c5a0ec39871ad200ffde403003b6c257afa1
|
7
|
+
data.tar.gz: 44049c4d0b0a0d8436df476f6d7de99f7fab0fc2169deeed8409152450d1d4dd602e80225bd90e903bee38bcef1a1ff835cf7906250527162d228ebd66f4c271
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.1.2
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- Ignore anonymous ActiveRecord classes when calling `sync_all!`.
|
12
|
+
|
7
13
|
## 1.1.1
|
8
14
|
|
9
15
|
- Freeze values returned from helper methods.
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Support Table Data
|
2
2
|
|
3
3
|
[![Continuous Integration](https://github.com/bdurand/support_table_data/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/bdurand/support_table_data/actions/workflows/continuous_integration.yml)
|
4
|
+
[![Regression Test](https://github.com/bdurand/support_table_data/actions/workflows/regression_test.yml/badge.svg)](https://github.com/bdurand/support_table_data/actions/workflows/regression_test.yml)
|
4
5
|
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/support_table_data.svg)](https://badge.fury.io/rb/support_table_data)
|
5
7
|
|
6
8
|
This gem provides a mixin for ActiveRecord support table models that allows you to load data from YAML, JSON, or CSV files and reference specific records more easily. It is intended to solve issues with support tables (also known as lookup tables) that contain a small set of canonical data that must exist for your application to work.
|
7
9
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/lib/support_table_data.rb
CHANGED
@@ -28,7 +28,7 @@ module SupportTableData
|
|
28
28
|
key = record[key_attribute].to_s
|
29
29
|
attributes = canonical_data.delete(key)
|
30
30
|
attributes&.each do |name, value|
|
31
|
-
record.send("#{name}=", value) if record.respond_to?("#{name}=", true)
|
31
|
+
record.send(:"#{name}=", value) if record.respond_to?(:"#{name}=", true)
|
32
32
|
end
|
33
33
|
if record.changed?
|
34
34
|
changes << record.changes
|
@@ -39,7 +39,7 @@ module SupportTableData
|
|
39
39
|
canonical_data.each_value do |attributes|
|
40
40
|
record = new
|
41
41
|
attributes.each do |name, value|
|
42
|
-
record.send("#{name}=", value) if record.respond_to?("#{name}=", true)
|
42
|
+
record.send(:"#{name}=", value) if record.respond_to?(:"#{name}=", true)
|
43
43
|
end
|
44
44
|
changes << record.changes
|
45
45
|
record.save!
|
@@ -132,7 +132,7 @@ module SupportTableData
|
|
132
132
|
support_table_data.each do |attributes|
|
133
133
|
key_value = attributes[key_attribute]
|
134
134
|
instance = new
|
135
|
-
instance.send("#{key_attribute}=", key_value)
|
135
|
+
instance.send(:"#{key_attribute}=", key_value)
|
136
136
|
values << instance.send(key_attribute)
|
137
137
|
end
|
138
138
|
@support_table_instance_keys = values.uniq
|
@@ -345,7 +345,8 @@ module SupportTableData
|
|
345
345
|
end
|
346
346
|
end
|
347
347
|
|
348
|
-
ActiveRecord::Base.descendants.
|
348
|
+
active_record_classes = ActiveRecord::Base.descendants.reject { |klass| klass.name.nil? }
|
349
|
+
active_record_classes.sort_by(&:name).each do |klass|
|
349
350
|
next unless klass.include?(SupportTableData)
|
350
351
|
next if klass.abstract_class?
|
351
352
|
next if classes.include?(klass)
|
data/support_table_data.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: support_table_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -46,7 +46,7 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- CHANGELOG.md
|
49
|
-
- MIT-LICENSE
|
49
|
+
- MIT-LICENSE.txt
|
50
50
|
- README.md
|
51
51
|
- VERSION
|
52
52
|
- lib/support_table_data.rb
|
@@ -65,14 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '2.5'
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.4.
|
75
|
+
rubygems_version: 3.4.10
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Extension for ActiveRecord models to manage synchronizing data in support/lookup
|
File without changes
|