chrono_model 1.2.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +19 -20
  3. data/README.md +62 -40
  4. data/lib/active_record/connection_adapters/chronomodel_adapter.rb +17 -11
  5. data/lib/active_record/tasks/chronomodel_database_tasks.rb +64 -23
  6. data/lib/chrono_model/adapter/ddl.rb +168 -153
  7. data/lib/chrono_model/adapter/indexes.rb +99 -94
  8. data/lib/chrono_model/adapter/migrations.rb +81 -104
  9. data/lib/chrono_model/adapter/migrations_modules/legacy.rb +41 -0
  10. data/lib/chrono_model/adapter/migrations_modules/stable.rb +41 -0
  11. data/lib/chrono_model/adapter/tsrange.rb +20 -5
  12. data/lib/chrono_model/adapter/upgrade.rb +89 -91
  13. data/lib/chrono_model/adapter.rb +64 -31
  14. data/lib/chrono_model/chrono.rb +17 -0
  15. data/lib/chrono_model/conversions.rb +15 -9
  16. data/lib/chrono_model/db_console.rb +9 -0
  17. data/lib/chrono_model/json.rb +9 -6
  18. data/lib/chrono_model/patches/as_of_time_holder.rb +2 -2
  19. data/lib/chrono_model/patches/as_of_time_relation.rb +2 -2
  20. data/lib/chrono_model/patches/association.rb +15 -12
  21. data/lib/chrono_model/patches/batches.rb +17 -0
  22. data/lib/chrono_model/patches/db_console.rb +20 -4
  23. data/lib/chrono_model/patches/join_node.rb +4 -4
  24. data/lib/chrono_model/patches/preloader.rb +41 -11
  25. data/lib/chrono_model/patches/relation.rb +53 -8
  26. data/lib/chrono_model/patches.rb +3 -1
  27. data/lib/chrono_model/railtie.rb +29 -24
  28. data/lib/chrono_model/time_gate.rb +3 -3
  29. data/lib/chrono_model/time_machine/history_model.rb +65 -31
  30. data/lib/chrono_model/time_machine/time_query.rb +65 -49
  31. data/lib/chrono_model/time_machine/timeline.rb +52 -28
  32. data/lib/chrono_model/time_machine.rb +66 -25
  33. data/lib/chrono_model/utilities.rb +3 -3
  34. data/lib/chrono_model/version.rb +3 -1
  35. data/lib/chrono_model.rb +31 -36
  36. metadata +39 -136
  37. data/.gitignore +0 -21
  38. data/.rspec +0 -2
  39. data/.travis.yml +0 -41
  40. data/Gemfile +0 -4
  41. data/README.sql +0 -161
  42. data/Rakefile +0 -25
  43. data/chrono_model.gemspec +0 -33
  44. data/gemfiles/rails_5.0.gemfile +0 -6
  45. data/gemfiles/rails_5.1.gemfile +0 -6
  46. data/gemfiles/rails_5.2.gemfile +0 -6
  47. data/spec/aruba/dbconsole_spec.rb +0 -25
  48. data/spec/aruba/fixtures/database_with_default_username_and_password.yml +0 -14
  49. data/spec/aruba/fixtures/database_without_username_and_password.yml +0 -11
  50. data/spec/aruba/fixtures/empty_structure.sql +0 -27
  51. data/spec/aruba/fixtures/migrations/56/20160812190335_create_impressions.rb +0 -10
  52. data/spec/aruba/fixtures/migrations/56/20171115195229_add_temporal_extension_to_impressions.rb +0 -10
  53. data/spec/aruba/fixtures/railsapp/config/application.rb +0 -17
  54. data/spec/aruba/fixtures/railsapp/config/boot.rb +0 -5
  55. data/spec/aruba/fixtures/railsapp/config/environments/development.rb +0 -38
  56. data/spec/aruba/migrations_spec.rb +0 -48
  57. data/spec/aruba/rake_task_spec.rb +0 -71
  58. data/spec/chrono_model/adapter/base_spec.rb +0 -157
  59. data/spec/chrono_model/adapter/ddl_spec.rb +0 -243
  60. data/spec/chrono_model/adapter/indexes_spec.rb +0 -72
  61. data/spec/chrono_model/adapter/migrations_spec.rb +0 -312
  62. data/spec/chrono_model/conversions_spec.rb +0 -43
  63. data/spec/chrono_model/history_models_spec.rb +0 -32
  64. data/spec/chrono_model/json_ops_spec.rb +0 -59
  65. data/spec/chrono_model/time_machine/as_of_spec.rb +0 -188
  66. data/spec/chrono_model/time_machine/changes_spec.rb +0 -50
  67. data/spec/chrono_model/time_machine/counter_cache_race_spec.rb +0 -46
  68. data/spec/chrono_model/time_machine/default_scope_spec.rb +0 -37
  69. data/spec/chrono_model/time_machine/history_spec.rb +0 -104
  70. data/spec/chrono_model/time_machine/keep_cool_spec.rb +0 -27
  71. data/spec/chrono_model/time_machine/manipulations_spec.rb +0 -84
  72. data/spec/chrono_model/time_machine/model_identification_spec.rb +0 -46
  73. data/spec/chrono_model/time_machine/sequence_spec.rb +0 -74
  74. data/spec/chrono_model/time_machine/sti_spec.rb +0 -100
  75. data/spec/chrono_model/time_machine/time_query_spec.rb +0 -261
  76. data/spec/chrono_model/time_machine/timeline_spec.rb +0 -63
  77. data/spec/chrono_model/time_machine/timestamps_spec.rb +0 -43
  78. data/spec/chrono_model/time_machine/transactions_spec.rb +0 -69
  79. data/spec/config.travis.yml +0 -5
  80. data/spec/config.yml.example +0 -9
  81. data/spec/spec_helper.rb +0 -33
  82. data/spec/support/adapter/helpers.rb +0 -53
  83. data/spec/support/adapter/structure.rb +0 -44
  84. data/spec/support/aruba.rb +0 -44
  85. data/spec/support/connection.rb +0 -70
  86. data/spec/support/matchers/base.rb +0 -56
  87. data/spec/support/matchers/column.rb +0 -99
  88. data/spec/support/matchers/function.rb +0 -79
  89. data/spec/support/matchers/index.rb +0 -69
  90. data/spec/support/matchers/schema.rb +0 -39
  91. data/spec/support/matchers/table.rb +0 -275
  92. data/spec/support/time_machine/helpers.rb +0 -47
  93. data/spec/support/time_machine/structure.rb +0 -111
  94. data/sql/json_ops.sql +0 -56
  95. data/sql/uninstall-json_ops.sql +0 -24
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'chrono_model/time_machine/time_query'
2
4
  require 'chrono_model/time_machine/timeline'
3
5
  require 'chrono_model/time_machine/history_model'
4
6
 
5
7
  module ChronoModel
6
-
7
8
  module TimeMachine
8
9
  include ChronoModel::Patches::AsOfTimeHolder
9
10
 
@@ -11,20 +12,50 @@ module ChronoModel
11
12
 
12
13
  included do
13
14
  if table_exists? && !chrono?
14
- puts "ChronoModel: #{table_name} is not a temporal table. " \
15
- "Please use `change_table :#{table_name}, temporal: true` in a migration."
15
+ logger.warn <<-MSG.squish
16
+ ChronoModel: #{table_name} is not a temporal table.
17
+ Please use `change_table :#{table_name}, temporal: true` in a migration.
18
+ MSG
16
19
  end
17
20
 
18
21
  history = ChronoModel::TimeMachine.define_history_model_for(self)
19
22
  ChronoModel.history_models[table_name] = history
20
23
 
21
24
  class << self
22
- alias_method :direct_descendants_with_history, :direct_descendants
23
- def direct_descendants
24
- direct_descendants_with_history.reject(&:history?)
25
+ if Rails.version >= '7.0'
26
+ def subclasses(with_history: false)
27
+ subclasses = super()
28
+ subclasses.reject!(&:history?) unless with_history
29
+ subclasses
30
+ end
31
+
32
+ def subclasses_with_history
33
+ subclasses(with_history: true)
34
+ end
35
+
36
+ # `direct_descendants` is deprecated method in 7.0 and has been
37
+ # removed in 7.1
38
+ if method_defined?(:direct_descendants)
39
+ alias_method :direct_descendants_with_history, :subclasses_with_history
40
+ alias_method :direct_descendants, :subclasses
41
+ end
42
+
43
+ # Ruby 3.1 has a native subclasses method and descendants is
44
+ # implemented with recursion of subclasses
45
+ if Class.method_defined?(:subclasses)
46
+ def descendants_with_history
47
+ subclasses_with_history.concat(subclasses.flat_map(&:descendants_with_history))
48
+ end
49
+ end
50
+ else
51
+ alias_method :descendants_with_history, :descendants
52
+
53
+ alias_method :direct_descendants_with_history, :direct_descendants
54
+ def direct_descendants
55
+ direct_descendants_with_history.reject(&:history?)
56
+ end
25
57
  end
26
58
 
27
- alias_method :descendants_with_history, :descendants
28
59
  def descendants
29
60
  descendants_with_history.reject(&:history?)
30
61
  end
@@ -43,9 +74,9 @@ module ChronoModel
43
74
  # Sadly, we can't avoid it by calling +.history?+, because in the
44
75
  # subclass the HistoryModel hasn't been included yet.
45
76
  #
46
- unless subclass.name.nil?
47
- ChronoModel::TimeMachine.define_history_model_for(subclass)
48
- end
77
+ return if subclass.name.nil?
78
+
79
+ ChronoModel::TimeMachine.define_history_model_for(subclass)
49
80
  end
50
81
  end
51
82
  end
@@ -71,21 +102,23 @@ module ChronoModel
71
102
 
72
103
  # Returns an ActiveRecord::Relation on the history of this model as
73
104
  # it was +time+ ago.
74
- def as_of(time)
75
- history.as_of(time)
76
- end
105
+ delegate :as_of, to: :history
77
106
 
78
107
  def attribute_names_for_history_changes
79
108
  @attribute_names_for_history_changes ||= attribute_names -
80
- %w( id hid validity recorded_at )
109
+ %w[id hid validity recorded_at]
81
110
  end
82
111
 
83
112
  def has_timeline(options)
84
113
  changes = options.delete(:changes)
85
114
  assocs = history.has_timeline(options)
86
115
 
87
- attributes = changes.present? ?
88
- Array.wrap(changes) : assocs.map(&:name)
116
+ attributes =
117
+ if changes.present?
118
+ Array.wrap(changes)
119
+ else
120
+ assocs.map(&:name)
121
+ end
89
122
 
90
123
  attribute_names_for_history_changes.concat(attributes.map(&:to_s))
91
124
  end
@@ -112,7 +145,7 @@ module ChronoModel
112
145
  # reasons, to avoid a `rescue` (@lleirborras).
113
146
  #
114
147
  def _as_of(time)
115
- self.class.as_of(time).where(id: self.id)
148
+ self.class.as_of(time).where(id: id)
116
149
  end
117
150
  protected :_as_of
118
151
 
@@ -132,13 +165,14 @@ module ChronoModel
132
165
  # Returns a boolean indicating whether this record is an history entry.
133
166
  #
134
167
  def historical?
135
- self.as_of_time.present?
168
+ as_of_time.present?
136
169
  end
137
170
 
138
171
  # Inhibit destroy of historical records
139
172
  #
140
173
  def destroy
141
174
  raise ActiveRecord::ReadOnlyRecord, 'Cannot delete historical records' if historical?
175
+
142
176
  super
143
177
  end
144
178
 
@@ -147,7 +181,7 @@ module ChronoModel
147
181
  #
148
182
  def pred(options = {})
149
183
  if self.class.timeline_associations.empty?
150
- history.order(Arel.sql('upper(validity) DESC')).offset(1).first
184
+ history.reverse_order.second
151
185
  else
152
186
  return nil unless (ts = pred_timestamp(options))
153
187
 
@@ -178,7 +212,11 @@ module ChronoModel
178
212
  # Returns the current history version
179
213
  #
180
214
  def current_version
181
- self.historical? ? self.class.find(self.id) : self
215
+ if historical?
216
+ self.class.find(id)
217
+ else
218
+ self
219
+ end
182
220
  end
183
221
 
184
222
  # Returns the differences between this entry and the previous history one.
@@ -196,17 +234,20 @@ module ChronoModel
196
234
  #
197
235
  def changes_against(ref)
198
236
  self.class.attribute_names_for_history_changes.inject({}) do |changes, attr|
199
- old, new = ref.public_send(attr), self.public_send(attr)
237
+ old = ref.public_send(attr)
238
+ new = public_send(attr)
200
239
 
201
240
  changes.tap do |c|
202
- changed = old.respond_to?(:history_eql?) ?
203
- !old.history_eql?(new) : old != new
241
+ changed =
242
+ if old.respond_to?(:history_eql?)
243
+ !old.history_eql?(new)
244
+ else
245
+ old != new
246
+ end
204
247
 
205
248
  c[attr] = [old, new] if changed
206
249
  end
207
250
  end
208
251
  end
209
-
210
252
  end
211
-
212
253
  end
@@ -1,5 +1,6 @@
1
- module ChronoModel
1
+ # frozen_string_literal: true
2
2
 
3
+ module ChronoModel
3
4
  module Utilities
4
5
  # Amends the given history item setting a different period.
5
6
  # Useful when migrating from legacy systems.
@@ -11,7 +12,7 @@ module ChronoModel
11
12
  # end
12
13
  #
13
14
  def amend_period!(hid, from, to)
14
- unless [from, to].any? {|ts| ts.respond_to?(:zone) && ts.zone == 'UTC'}
15
+ unless [from, to].any? { |ts| ts.respond_to?(:zone) && ts.zone == 'UTC' }
15
16
  raise 'Can amend history only with UTC timestamps'
16
17
  end
17
18
 
@@ -23,5 +24,4 @@ module ChronoModel
23
24
  ]
24
25
  end
25
26
  end
26
-
27
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ChronoModel
2
- VERSION = "1.2.2"
4
+ VERSION = '2.0.0'
3
5
  end
data/lib/chrono_model.rb CHANGED
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
 
5
+ require 'chrono_model/chrono'
3
6
  require 'chrono_model/conversions'
4
7
  require 'chrono_model/patches'
5
8
  require 'chrono_model/adapter'
@@ -7,8 +10,11 @@ require 'chrono_model/time_machine'
7
10
  require 'chrono_model/time_gate'
8
11
  require 'chrono_model/version'
9
12
 
13
+ require 'chrono_model/railtie' if defined?(Rails::Railtie)
14
+ require 'chrono_model/db_console' if defined?(Rails::DBConsole) && Rails.version < '7.1'
15
+
10
16
  module ChronoModel
11
- class Error < ActiveRecord::ActiveRecordError #:nodoc:
17
+ class Error < ActiveRecord::ActiveRecordError # :nodoc:
12
18
  end
13
19
 
14
20
  # Performs structure upgrade.
@@ -17,7 +23,7 @@ module ChronoModel
17
23
  connection = ActiveRecord::Base.connection
18
24
 
19
25
  unless connection.is_a?(ChronoModel::Adapter)
20
- raise ChronoModel::Error, "This database connection is not a ChronoModel::Adapter"
26
+ raise ChronoModel::Error, 'This database connection is not a ChronoModel::Adapter'
21
27
  end
22
28
 
23
29
  connection.chrono_upgrade!
@@ -27,49 +33,38 @@ module ChronoModel
27
33
  # Computed upon inclusion of the +TimeMachine+ module.
28
34
  #
29
35
  def self.history_models
30
- @_history_models||= {}
36
+ @_history_models ||= {}
31
37
  end
32
38
  end
33
39
 
34
- if defined?(Rails)
35
- require 'chrono_model/railtie'
36
- end
40
+ ActiveSupport.on_load :active_record do
41
+ extend ChronoModel::Chrono
37
42
 
38
- ActiveRecord::Base.instance_eval do
39
- # Checks whether this Active Recoed model is backed by a temporal table
40
- #
41
- def chrono?
42
- connection.is_chrono?(table_name)
43
- end
44
- end
43
+ # Hooks into Association#scope to pass the As-Of time automatically
44
+ # to methods that load associated ChronoModel records.
45
+ ActiveRecord::Associations::Association.prepend ChronoModel::Patches::Association
45
46
 
46
- # Hooks into Association#scope to pass the As-Of time automatically
47
- # to methods that load associated ChronoModel records.
48
- #
49
- ActiveRecord::Associations::Association.instance_eval do
50
- prepend ChronoModel::Patches::Association
51
- end
47
+ # Hooks into Relation#build_arel to use `:joins` on your ChronoModels
48
+ # and join data from associated records As-Of time.
49
+ ActiveRecord::Relation.prepend ChronoModel::Patches::Relation
52
50
 
53
- # Hooks into Relation#build_arel to use :joins on your ChronoModels
54
- # and join data from associated records As-Of time.
55
- #
56
- ActiveRecord::Relation.instance_eval do
57
- prepend ChronoModel::Patches::Relation
58
- end
51
+ # Hooks in two points of the AR Preloader to preload As-Of time records of
52
+ # associated ChronoModels. is used by `.includes`, `.preload`, and `.eager_load`.
53
+ ActiveRecord::Associations::Preloader.prepend ChronoModel::Patches::Preloader
54
+
55
+ ActiveRecord::Associations::Preloader::Association.prepend ChronoModel::Patches::Preloader::Association
59
56
 
60
- # Hooks in two points of the AR Preloader to preload As-Of time records of
61
- # associated ChronoModels. is used by .includes, .preload and .eager_load.
62
- #
63
- ActiveRecord::Associations::Preloader.instance_eval do
64
- prepend ChronoModel::Patches::Preloader
57
+ ActiveRecord::Associations::Preloader::ThroughAssociation.prepend ChronoModel::Patches::Preloader::ThroughAssociation
58
+
59
+ ActiveRecord::Batches::BatchEnumerator.prepend ChronoModel::Patches::Batches::BatchEnumerator
65
60
  end
66
61
 
67
- ActiveRecord::Associations::Preloader::Association.instance_eval do
68
- prepend ChronoModel::Patches::Preloader::Association
62
+ ActiveSupport.on_load :after_initialize do
63
+ next if Rails.application.config.active_record.schema_format == :sql
64
+
65
+ raise 'In order to use ChronoModel, set `config.active_record.schema_format` to `:sql`'
69
66
  end
70
67
 
71
- if defined?(Rails::DBConsole)
72
- Rails::DBConsole.instance_eval do
73
- prepend ChronoModel::Patches::DBConsole
74
- end
68
+ if ActiveRecord::ConnectionAdapters.respond_to?(:register)
69
+ ActiveRecord::ConnectionAdapters.register 'chronomodel', 'ChronoModel::Adapter', 'chrono_model/adapter'
75
70
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chrono_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcello Barnaba
8
8
  - Peter Joseph Brindisi
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-06 00:00:00.000000000 Z
12
+ date: 2024-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,16 +17,16 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 5.0.0
20
+ version: '5.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 5.0.0
27
+ version: '5.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: pg
29
+ name: multi_json
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
@@ -40,21 +40,21 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: multi_json
43
+ name: pg
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - ">"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: '1.1'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - ">"
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: '1.1'
56
56
  - !ruby/object:Gem::Dependency
57
- name: rails
57
+ name: aruba
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
@@ -68,7 +68,7 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
- name: aruba
71
+ name: bundler
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
@@ -82,7 +82,7 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
- name: pry
85
+ name: byebug
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
@@ -96,7 +96,7 @@ dependencies:
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
- name: hirb
99
+ name: fuubar
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
@@ -110,7 +110,7 @@ dependencies:
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
- name: byebug
113
+ name: hirb
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
@@ -124,7 +124,7 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
- name: rspec
127
+ name: pry
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ">="
@@ -138,7 +138,7 @@ dependencies:
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  - !ruby/object:Gem::Dependency
141
- name: rake
141
+ name: rails
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - ">="
@@ -152,7 +152,7 @@ dependencies:
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  - !ruby/object:Gem::Dependency
155
- name: fuubar
155
+ name: rake
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
@@ -166,7 +166,7 @@ dependencies:
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  - !ruby/object:Gem::Dependency
169
- name: simplecov
169
+ name: rspec
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - ">="
@@ -180,7 +180,7 @@ dependencies:
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  - !ruby/object:Gem::Dependency
183
- name: codeclimate-test-reporter
183
+ name: simplecov
184
184
  requirement: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - ">="
@@ -194,7 +194,7 @@ dependencies:
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  description: Give your models as-of date temporal extensions. Built entirely for PostgreSQL
197
- >= 9.3
197
+ >= 9.4
198
198
  email:
199
199
  - vjt@openssl.it
200
200
  - p.brindisi@ifad.org
@@ -202,18 +202,8 @@ executables: []
202
202
  extensions: []
203
203
  extra_rdoc_files: []
204
204
  files:
205
- - ".gitignore"
206
- - ".rspec"
207
- - ".travis.yml"
208
- - Gemfile
209
205
  - LICENSE
210
206
  - README.md
211
- - README.sql
212
- - Rakefile
213
- - chrono_model.gemspec
214
- - gemfiles/rails_5.0.gemfile
215
- - gemfiles/rails_5.1.gemfile
216
- - gemfiles/rails_5.2.gemfile
217
207
  - lib/active_record/connection_adapters/chronomodel_adapter.rb
218
208
  - lib/active_record/tasks/chronomodel_database_tasks.rb
219
209
  - lib/chrono_model.rb
@@ -221,14 +211,19 @@ files:
221
211
  - lib/chrono_model/adapter/ddl.rb
222
212
  - lib/chrono_model/adapter/indexes.rb
223
213
  - lib/chrono_model/adapter/migrations.rb
214
+ - lib/chrono_model/adapter/migrations_modules/legacy.rb
215
+ - lib/chrono_model/adapter/migrations_modules/stable.rb
224
216
  - lib/chrono_model/adapter/tsrange.rb
225
217
  - lib/chrono_model/adapter/upgrade.rb
218
+ - lib/chrono_model/chrono.rb
226
219
  - lib/chrono_model/conversions.rb
220
+ - lib/chrono_model/db_console.rb
227
221
  - lib/chrono_model/json.rb
228
222
  - lib/chrono_model/patches.rb
229
223
  - lib/chrono_model/patches/as_of_time_holder.rb
230
224
  - lib/chrono_model/patches/as_of_time_relation.rb
231
225
  - lib/chrono_model/patches/association.rb
226
+ - lib/chrono_model/patches/batches.rb
232
227
  - lib/chrono_model/patches/db_console.rb
233
228
  - lib/chrono_model/patches/join_node.rb
234
229
  - lib/chrono_model/patches/preloader.rb
@@ -241,59 +236,15 @@ files:
241
236
  - lib/chrono_model/time_machine/timeline.rb
242
237
  - lib/chrono_model/utilities.rb
243
238
  - lib/chrono_model/version.rb
244
- - spec/aruba/dbconsole_spec.rb
245
- - spec/aruba/fixtures/database_with_default_username_and_password.yml
246
- - spec/aruba/fixtures/database_without_username_and_password.yml
247
- - spec/aruba/fixtures/empty_structure.sql
248
- - spec/aruba/fixtures/migrations/56/20160812190335_create_impressions.rb
249
- - spec/aruba/fixtures/migrations/56/20171115195229_add_temporal_extension_to_impressions.rb
250
- - spec/aruba/fixtures/railsapp/config/application.rb
251
- - spec/aruba/fixtures/railsapp/config/boot.rb
252
- - spec/aruba/fixtures/railsapp/config/environments/development.rb
253
- - spec/aruba/migrations_spec.rb
254
- - spec/aruba/rake_task_spec.rb
255
- - spec/chrono_model/adapter/base_spec.rb
256
- - spec/chrono_model/adapter/ddl_spec.rb
257
- - spec/chrono_model/adapter/indexes_spec.rb
258
- - spec/chrono_model/adapter/migrations_spec.rb
259
- - spec/chrono_model/conversions_spec.rb
260
- - spec/chrono_model/history_models_spec.rb
261
- - spec/chrono_model/json_ops_spec.rb
262
- - spec/chrono_model/time_machine/as_of_spec.rb
263
- - spec/chrono_model/time_machine/changes_spec.rb
264
- - spec/chrono_model/time_machine/counter_cache_race_spec.rb
265
- - spec/chrono_model/time_machine/default_scope_spec.rb
266
- - spec/chrono_model/time_machine/history_spec.rb
267
- - spec/chrono_model/time_machine/keep_cool_spec.rb
268
- - spec/chrono_model/time_machine/manipulations_spec.rb
269
- - spec/chrono_model/time_machine/model_identification_spec.rb
270
- - spec/chrono_model/time_machine/sequence_spec.rb
271
- - spec/chrono_model/time_machine/sti_spec.rb
272
- - spec/chrono_model/time_machine/time_query_spec.rb
273
- - spec/chrono_model/time_machine/timeline_spec.rb
274
- - spec/chrono_model/time_machine/timestamps_spec.rb
275
- - spec/chrono_model/time_machine/transactions_spec.rb
276
- - spec/config.travis.yml
277
- - spec/config.yml.example
278
- - spec/spec_helper.rb
279
- - spec/support/adapter/helpers.rb
280
- - spec/support/adapter/structure.rb
281
- - spec/support/aruba.rb
282
- - spec/support/connection.rb
283
- - spec/support/matchers/base.rb
284
- - spec/support/matchers/column.rb
285
- - spec/support/matchers/function.rb
286
- - spec/support/matchers/index.rb
287
- - spec/support/matchers/schema.rb
288
- - spec/support/matchers/table.rb
289
- - spec/support/time_machine/helpers.rb
290
- - spec/support/time_machine/structure.rb
291
- - sql/json_ops.sql
292
- - sql/uninstall-json_ops.sql
293
239
  homepage: https://github.com/ifad/chronomodel
294
- licenses: []
295
- metadata: {}
296
- post_install_message:
240
+ licenses:
241
+ - MIT
242
+ metadata:
243
+ bug_tracker_uri: https://github.com/ifad/chronomodel/issues
244
+ homepage_uri: https://github.com/ifad/chronomodel
245
+ source_code_uri: https://github.com/ifad/chronomodel
246
+ rubygems_mfa_required: 'true'
247
+ post_install_message:
297
248
  rdoc_options: []
298
249
  require_paths:
299
250
  - lib
@@ -301,63 +252,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
301
252
  requirements:
302
253
  - - ">="
303
254
  - !ruby/object:Gem::Version
304
- version: '0'
255
+ version: 2.2.2
305
256
  required_rubygems_version: !ruby/object:Gem::Requirement
306
257
  requirements:
307
258
  - - ">="
308
259
  - !ruby/object:Gem::Version
309
260
  version: '0'
310
261
  requirements: []
311
- rubyforge_project:
312
- rubygems_version: 2.7.6.2
313
- signing_key:
262
+ rubygems_version: 3.5.3
263
+ signing_key:
314
264
  specification_version: 4
315
265
  summary: Temporal extensions (SCD Type II) for Active Record
316
- test_files:
317
- - spec/aruba/dbconsole_spec.rb
318
- - spec/aruba/fixtures/database_with_default_username_and_password.yml
319
- - spec/aruba/fixtures/database_without_username_and_password.yml
320
- - spec/aruba/fixtures/empty_structure.sql
321
- - spec/aruba/fixtures/migrations/56/20160812190335_create_impressions.rb
322
- - spec/aruba/fixtures/migrations/56/20171115195229_add_temporal_extension_to_impressions.rb
323
- - spec/aruba/fixtures/railsapp/config/application.rb
324
- - spec/aruba/fixtures/railsapp/config/boot.rb
325
- - spec/aruba/fixtures/railsapp/config/environments/development.rb
326
- - spec/aruba/migrations_spec.rb
327
- - spec/aruba/rake_task_spec.rb
328
- - spec/chrono_model/adapter/base_spec.rb
329
- - spec/chrono_model/adapter/ddl_spec.rb
330
- - spec/chrono_model/adapter/indexes_spec.rb
331
- - spec/chrono_model/adapter/migrations_spec.rb
332
- - spec/chrono_model/conversions_spec.rb
333
- - spec/chrono_model/history_models_spec.rb
334
- - spec/chrono_model/json_ops_spec.rb
335
- - spec/chrono_model/time_machine/as_of_spec.rb
336
- - spec/chrono_model/time_machine/changes_spec.rb
337
- - spec/chrono_model/time_machine/counter_cache_race_spec.rb
338
- - spec/chrono_model/time_machine/default_scope_spec.rb
339
- - spec/chrono_model/time_machine/history_spec.rb
340
- - spec/chrono_model/time_machine/keep_cool_spec.rb
341
- - spec/chrono_model/time_machine/manipulations_spec.rb
342
- - spec/chrono_model/time_machine/model_identification_spec.rb
343
- - spec/chrono_model/time_machine/sequence_spec.rb
344
- - spec/chrono_model/time_machine/sti_spec.rb
345
- - spec/chrono_model/time_machine/time_query_spec.rb
346
- - spec/chrono_model/time_machine/timeline_spec.rb
347
- - spec/chrono_model/time_machine/timestamps_spec.rb
348
- - spec/chrono_model/time_machine/transactions_spec.rb
349
- - spec/config.travis.yml
350
- - spec/config.yml.example
351
- - spec/spec_helper.rb
352
- - spec/support/adapter/helpers.rb
353
- - spec/support/adapter/structure.rb
354
- - spec/support/aruba.rb
355
- - spec/support/connection.rb
356
- - spec/support/matchers/base.rb
357
- - spec/support/matchers/column.rb
358
- - spec/support/matchers/function.rb
359
- - spec/support/matchers/index.rb
360
- - spec/support/matchers/schema.rb
361
- - spec/support/matchers/table.rb
362
- - spec/support/time_machine/helpers.rb
363
- - spec/support/time_machine/structure.rb
266
+ test_files: []
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- .byebug_history
7
- Gemfile.lock
8
- gemfiles/*.lock
9
- InstalledFiles
10
- _yardoc
11
- coverage
12
- doc/
13
- lib/bundler/man
14
- pkg
15
- rdoc
16
- spec/reports
17
- spec/config.yml
18
- spec/debug.log
19
- test/tmp
20
- test/version_tmp
21
- tmp
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format Fuubar