usps-support 0.2.65 → 0.2.66
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 +4 -4
- data/db/hq/members_schema.rb +13 -0
- data/lib/usps/support/models/hq/schemas.rb +25 -0
- data/lib/usps/support/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe5075012e0988ba212db3443f7e168933e1477def45cfcecab1dfe20926d823
|
|
4
|
+
data.tar.gz: 93316be136f7099ee57549e282c8f46df57e2cf7111163f91688a962d3b6f20b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa3cec6e37810a31590322d78d3a67fbe6e4fc284561616dc7023274eaaf3061db96222e1d1a8c3f8a532af5b3b95f2b2752f5cef25ef5c54e7ffbc7cef2b3c7
|
|
7
|
+
data.tar.gz: '09ebdb0cffb6cdedea903c65e9f3fa8fc2f2512823aad557733b121ca5a241f503e0caf16372d323071e63e2eae3f7aeb1c4cdac8c4ad83ee8e2fde8f326f847'
|
data/db/hq/members_schema.rb
CHANGED
|
@@ -39,6 +39,19 @@ ActiveRecord::Schema[8.1].define do
|
|
|
39
39
|
t.string "grade", limit: 2
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
create_table "associates", primary_key: ["squadno", "certno"], charset: "latin1", comment: "dtb-Associate and Honorary Members", force: :cascade do |t|
|
|
43
|
+
t.integer "id", null: false, auto_increment: true
|
|
44
|
+
t.integer "squadno", default: 0, null: false
|
|
45
|
+
t.integer "dist", default: 0, null: false
|
|
46
|
+
t.string "certno", limit: 7, default: "", null: false
|
|
47
|
+
t.string "first", limit: 15
|
|
48
|
+
t.string "last", limit: 25
|
|
49
|
+
t.string "type", limit: 1
|
|
50
|
+
t.string "notes"
|
|
51
|
+
t.string "modified", limit: 6
|
|
52
|
+
t.index ["id"], name: "id_index"
|
|
53
|
+
end
|
|
54
|
+
|
|
42
55
|
create_table "djdesc", primary_key: "jobcode", id: { type: :string, limit: 7 }, charset: "latin1", comment: "dtb-depreciated use jobcodes or djftp", force: :cascade do |t|
|
|
43
56
|
t.string "jdesc", limit: 100
|
|
44
57
|
t.string "rank", limit: 3, null: false
|
|
@@ -9,6 +9,9 @@ module Usps::Support::Models::Hq
|
|
|
9
9
|
module Schemas
|
|
10
10
|
SCHEMA_DIR = File.join(Usps::Support::ROOT, 'db/hq')
|
|
11
11
|
|
|
12
|
+
# How a host app's schema file delegates here.
|
|
13
|
+
DELEGATION = /\bSchemas\.load_schemas?\b/
|
|
14
|
+
|
|
12
15
|
class << self
|
|
13
16
|
# Load one or more HQ schemas into the currently-active connection.
|
|
14
17
|
# Typically called from a host app's `db/<name>_schema.rb` shim so
|
|
@@ -20,6 +23,28 @@ module Usps::Support::Models::Hq
|
|
|
20
23
|
def load_schema(name)
|
|
21
24
|
load File.join(SCHEMA_DIR, "#{name}_schema.rb")
|
|
22
25
|
end
|
|
26
|
+
|
|
27
|
+
# Every schema this version of the gem ships, as one string.
|
|
28
|
+
def shipped_source = Dir[File.join(SCHEMA_DIR, '*_schema.rb')].map { File.read(it) }.join
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Rails reloads a test database's schema only when the schema file's SHA1
|
|
32
|
+
# differs from the one recorded at its last load. A host app's file only
|
|
33
|
+
# delegates here, so it never changes when a gem update ships a different
|
|
34
|
+
# schema, and the test database would keep the old one until reloaded by
|
|
35
|
+
# hand. Folding the shipped schemas into a delegating file's digest makes
|
|
36
|
+
# `maintain_test_schema!` reload it after any such update.
|
|
37
|
+
module SchemaDigest
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
def schema_sha1(file)
|
|
41
|
+
source = File.read(file)
|
|
42
|
+
return super unless source.match?(DELEGATION)
|
|
43
|
+
|
|
44
|
+
OpenSSL::Digest::SHA1.hexdigest(source + Schemas.shipped_source)
|
|
45
|
+
end
|
|
23
46
|
end
|
|
24
47
|
end
|
|
25
48
|
end
|
|
49
|
+
|
|
50
|
+
ActiveRecord::Tasks::DatabaseTasks.singleton_class.prepend(Usps::Support::Models::Hq::Schemas::SchemaDigest)
|
data/lib/usps/support/version.rb
CHANGED