activerecord-bitemporal-tablize 0.1.0 → 0.1.1
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/Gemfile.lock +50 -0
- data/lib/activerecord-bitemporal-tablize.rb +2 -0
- data/lib/activerecord/bitemporal/bitemporalize/instance_methods.rb +15 -0
- data/lib/activerecord/bitemporal/string_half_width_size.rb +13 -0
- data/lib/activerecord/bitemporal/tablize.rb +4 -3
- data/lib/activerecord/bitemporal/tablize/version.rb +1 -1
- metadata +5 -3
- data/lib/activerecord/bitemporal.rb +0 -11
- data/lib/activerecord/bitemporal/tablize/string_half_width_size.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70de8844f5350436e2c63ba028631191b4945c9438c7a9fe38edb15da92078b0
|
4
|
+
data.tar.gz: f4158dd30e7e2d57671cf560c40afd1dc440c200c4bf3ac6c71b8e34163bbfa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1c2b6291e26d91067214fc1747ba63a68f2d7f3a6c1ef92523505c22a7268f8cc54bcd45beebd25a9e68a03269c609857a66dff31b4bfa8f39195e56234e294
|
7
|
+
data.tar.gz: c49f90a02ebdaa545aa9f99fee351fcb6630030138b086d0c973017565b7a7c6c6b8164da0746d5c4b9b191110e707738854945571e2469100a9f1edc04c5f3c
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
activerecord-bitemporal-tablize (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activerecord-bitemporal (0.0.1)
|
10
|
+
activesupport (6.1.3.2)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
concurrent-ruby (1.1.8)
|
17
|
+
diff-lcs (1.3)
|
18
|
+
i18n (1.8.10)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
minitest (5.14.4)
|
21
|
+
rake (13.0.3)
|
22
|
+
rspec (3.8.0)
|
23
|
+
rspec-core (~> 3.8.0)
|
24
|
+
rspec-expectations (~> 3.8.0)
|
25
|
+
rspec-mocks (~> 3.8.0)
|
26
|
+
rspec-core (3.8.0)
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-expectations (3.8.1)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.8.0)
|
31
|
+
rspec-mocks (3.8.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.8.0)
|
34
|
+
rspec-support (3.8.0)
|
35
|
+
tzinfo (2.0.4)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
zeitwerk (2.4.2)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
x86_64-linux
|
41
|
+
|
42
|
+
DEPENDENCIES
|
43
|
+
activerecord-bitemporal
|
44
|
+
activerecord-bitemporal-tablize!
|
45
|
+
activesupport
|
46
|
+
rake (~> 13.0)
|
47
|
+
rspec (~> 3.0)
|
48
|
+
|
49
|
+
BUNDLED WITH
|
50
|
+
2.2.15
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module Bitemporal
|
3
|
+
module Bitemporalize
|
4
|
+
module InstanceMethods
|
5
|
+
def history
|
6
|
+
self.class.ignore_valid_datetime.bitemporal_for(bitemporal_id).order(valid_from: :desc).tap do |records|
|
7
|
+
records.define_singleton_method(:print_table) do |*attributes|
|
8
|
+
print ActiveRecord::Bitemporal::Tablize.new(records: records, attributes: attributes).call
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
require 'activerecord/bitemporal/tablize/version'
|
2
|
+
require 'activerecord/bitemporal/string_half_width_size'
|
3
|
+
require 'active_support/all'
|
3
4
|
|
4
5
|
class ActiveRecord::Bitemporal::Tablize
|
5
|
-
using StringHalfWidthSize
|
6
|
+
using ActiveRecord::Bitemporal::StringHalfWidthSize
|
6
7
|
|
7
8
|
attr :records, :result, :attributes
|
8
9
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-bitemporal-tablize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lighty
|
@@ -22,14 +22,16 @@ files:
|
|
22
22
|
- ".gitignore"
|
23
23
|
- ".rspec"
|
24
24
|
- Gemfile
|
25
|
+
- Gemfile.lock
|
25
26
|
- README.md
|
26
27
|
- Rakefile
|
27
28
|
- activerecord-bitemporal-tablize.gemspec
|
28
29
|
- bin/console
|
29
30
|
- bin/setup
|
30
|
-
- lib/activerecord
|
31
|
+
- lib/activerecord-bitemporal-tablize.rb
|
32
|
+
- lib/activerecord/bitemporal/bitemporalize/instance_methods.rb
|
33
|
+
- lib/activerecord/bitemporal/string_half_width_size.rb
|
31
34
|
- lib/activerecord/bitemporal/tablize.rb
|
32
|
-
- lib/activerecord/bitemporal/tablize/string_half_width_size.rb
|
33
35
|
- lib/activerecord/bitemporal/tablize/version.rb
|
34
36
|
homepage: https://github.com/lighty/activerecord-bitemporal-tablize
|
35
37
|
licenses: []
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module ActiveRecord
|
2
|
-
class Bitemporal
|
3
|
-
def history
|
4
|
-
self.class.ignore_valid_datetime.bitemporal_for(bitemporal_id).order(valid_from: :desc).tap do |records|
|
5
|
-
records.define_singleton_method(:print_table) do |*attributes|
|
6
|
-
print ActiveRecord::Bitemporal::Tablize.new(records: records, attributes: attributes).call
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|