sequel 5.30.0 → 5.35.0
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/CHANGELOG +86 -0
- data/README.rdoc +1 -1
- data/doc/advanced_associations.rdoc +4 -4
- data/doc/association_basics.rdoc +10 -5
- data/doc/code_order.rdoc +12 -2
- data/doc/dataset_filtering.rdoc +2 -2
- data/doc/model_dataset_method_design.rdoc +1 -1
- data/doc/postgresql.rdoc +71 -0
- data/doc/release_notes/5.31.0.txt +148 -0
- data/doc/release_notes/5.32.0.txt +46 -0
- data/doc/release_notes/5.33.0.txt +24 -0
- data/doc/release_notes/5.34.0.txt +40 -0
- data/doc/release_notes/5.35.0.txt +56 -0
- data/doc/testing.rdoc +1 -1
- data/lib/sequel/adapters/oracle.rb +2 -1
- data/lib/sequel/adapters/shared/access.rb +6 -6
- data/lib/sequel/adapters/shared/mssql.rb +5 -5
- data/lib/sequel/adapters/shared/mysql.rb +9 -9
- data/lib/sequel/adapters/shared/oracle.rb +16 -16
- data/lib/sequel/adapters/shared/postgres.rb +169 -14
- data/lib/sequel/adapters/shared/sqlanywhere.rb +9 -9
- data/lib/sequel/adapters/shared/sqlite.rb +33 -6
- data/lib/sequel/adapters/tinytds.rb +1 -0
- data/lib/sequel/connection_pool/sharded_single.rb +4 -1
- data/lib/sequel/connection_pool/sharded_threaded.rb +12 -12
- data/lib/sequel/connection_pool/single.rb +1 -1
- data/lib/sequel/connection_pool/threaded.rb +2 -2
- data/lib/sequel/core.rb +318 -314
- data/lib/sequel/database/connecting.rb +1 -1
- data/lib/sequel/database/misc.rb +16 -10
- data/lib/sequel/database/query.rb +3 -1
- data/lib/sequel/database/schema_generator.rb +0 -1
- data/lib/sequel/database/schema_methods.rb +15 -16
- data/lib/sequel/database/transactions.rb +7 -4
- data/lib/sequel/dataset/placeholder_literalizer.rb +3 -7
- data/lib/sequel/dataset/query.rb +5 -4
- data/lib/sequel/deprecated.rb +3 -1
- data/lib/sequel/exceptions.rb +2 -0
- data/lib/sequel/extensions/_pretty_table.rb +1 -2
- data/lib/sequel/extensions/columns_introspection.rb +1 -2
- data/lib/sequel/extensions/connection_expiration.rb +2 -2
- data/lib/sequel/extensions/connection_validator.rb +2 -2
- data/lib/sequel/extensions/core_refinements.rb +2 -0
- data/lib/sequel/extensions/duplicate_columns_handler.rb +2 -0
- data/lib/sequel/extensions/fiber_concurrency.rb +24 -0
- data/lib/sequel/extensions/index_caching.rb +9 -7
- data/lib/sequel/extensions/integer64.rb +2 -0
- data/lib/sequel/extensions/migration.rb +1 -2
- data/lib/sequel/extensions/pg_array_ops.rb +4 -0
- data/lib/sequel/extensions/pg_enum.rb +7 -2
- data/lib/sequel/extensions/pg_extended_date_support.rb +1 -1
- data/lib/sequel/extensions/pg_hstore.rb +6 -0
- data/lib/sequel/extensions/pg_hstore_ops.rb +2 -0
- data/lib/sequel/extensions/pg_inet.rb +15 -5
- data/lib/sequel/extensions/pg_interval.rb +2 -0
- data/lib/sequel/extensions/pg_json_ops.rb +2 -0
- data/lib/sequel/extensions/pg_range.rb +5 -7
- data/lib/sequel/extensions/pg_range_ops.rb +2 -0
- data/lib/sequel/extensions/pg_row.rb +0 -1
- data/lib/sequel/extensions/pg_timestamptz.rb +2 -0
- data/lib/sequel/extensions/run_transaction_hooks.rb +72 -0
- data/lib/sequel/extensions/s.rb +2 -0
- data/lib/sequel/extensions/schema_dumper.rb +10 -4
- data/lib/sequel/extensions/server_block.rb +3 -3
- data/lib/sequel/extensions/symbol_aref_refinement.rb +2 -0
- data/lib/sequel/extensions/symbol_as_refinement.rb +2 -0
- data/lib/sequel/extensions/to_dot.rb +9 -3
- data/lib/sequel/model.rb +2 -0
- data/lib/sequel/model/associations.rb +54 -25
- data/lib/sequel/model/base.rb +70 -57
- data/lib/sequel/model/plugins.rb +3 -3
- data/lib/sequel/plugins/association_lazy_eager_option.rb +66 -0
- data/lib/sequel/plugins/association_multi_add_remove.rb +2 -0
- data/lib/sequel/plugins/association_pks.rb +60 -18
- data/lib/sequel/plugins/association_proxies.rb +2 -0
- data/lib/sequel/plugins/blacklist_security.rb +1 -2
- data/lib/sequel/plugins/boolean_subsets.rb +4 -1
- data/lib/sequel/plugins/class_table_inheritance.rb +28 -28
- data/lib/sequel/plugins/csv_serializer.rb +2 -0
- data/lib/sequel/plugins/dirty.rb +13 -13
- data/lib/sequel/plugins/forbid_lazy_load.rb +216 -0
- data/lib/sequel/plugins/instance_specific_default.rb +113 -0
- data/lib/sequel/plugins/json_serializer.rb +3 -7
- data/lib/sequel/plugins/lazy_attributes.rb +1 -1
- data/lib/sequel/plugins/pg_array_associations.rb +2 -3
- data/lib/sequel/plugins/prepared_statements.rb +5 -11
- data/lib/sequel/plugins/prepared_statements_safe.rb +1 -3
- data/lib/sequel/plugins/rcte_tree.rb +10 -16
- data/lib/sequel/plugins/single_table_inheritance.rb +15 -15
- data/lib/sequel/plugins/skip_saving_columns.rb +108 -0
- data/lib/sequel/plugins/string_stripper.rb +1 -1
- data/lib/sequel/plugins/subclasses.rb +2 -0
- data/lib/sequel/plugins/validation_class_methods.rb +5 -1
- data/lib/sequel/timezones.rb +6 -4
- data/lib/sequel/version.rb +1 -1
- metadata +18 -2
|
@@ -106,17 +106,13 @@ module Sequel
|
|
|
106
106
|
# and breaks some aspects of the json_serializer plugin. You can undo the damage
|
|
107
107
|
# done by active_support/json by doing:
|
|
108
108
|
#
|
|
109
|
-
#
|
|
110
|
-
# def to_json(options = {})
|
|
111
|
-
# JSON.generate(self)
|
|
112
|
-
# end
|
|
113
|
-
# end
|
|
114
|
-
#
|
|
115
|
-
# class Hash
|
|
109
|
+
# module ActiveSupportBrokenJSONFix
|
|
116
110
|
# def to_json(options = {})
|
|
117
111
|
# JSON.generate(self)
|
|
118
112
|
# end
|
|
119
113
|
# end
|
|
114
|
+
# Array.send(:prepend, ActiveSupportBrokenJSONFix)
|
|
115
|
+
# Hash.send(:prepend, ActiveSupportBrokenJSONFix)
|
|
120
116
|
#
|
|
121
117
|
# Note that this will probably cause active_support/json to no longer work
|
|
122
118
|
# correctly in some cases.
|
|
@@ -98,7 +98,7 @@ module Sequel
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
if retrieved_with
|
|
101
|
-
|
|
101
|
+
primary_key = model.primary_key
|
|
102
102
|
composite_pk = true if primary_key.is_a?(Array)
|
|
103
103
|
id_map = {}
|
|
104
104
|
retrieved_with.each{|o| id_map[o.pk] = o unless o.values.has_key?(a) || o.frozen?}
|
|
@@ -341,10 +341,9 @@ module Sequel
|
|
|
341
341
|
eo[:loader] = false
|
|
342
342
|
|
|
343
343
|
eager_load_results(opts, eo) do |assoc_record|
|
|
344
|
-
if pks
|
|
344
|
+
if pks = assoc_record.get_column_value(key)
|
|
345
345
|
pks.each do |pkv|
|
|
346
|
-
|
|
347
|
-
objects.each do |object|
|
|
346
|
+
id_map[pkv].each do |object|
|
|
348
347
|
object.associations[name].push(assoc_record)
|
|
349
348
|
end
|
|
350
349
|
end
|
|
@@ -41,11 +41,9 @@ module Sequel
|
|
|
41
41
|
# Create a prepared statement, but modify the SQL used so that the model's columns are explicitly
|
|
42
42
|
# selected instead of using *, assuming that the dataset selects from a single table.
|
|
43
43
|
def prepare_explicit_statement(ds, type, vals=OPTS)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if f && f.length == 1 && !ds.opts[:join] && (!s || s.empty?)
|
|
48
|
-
ds = ds.public_send(meth, *columns.map{|c| Sequel.identifier(c)})
|
|
44
|
+
s = ds.opts[:returning]
|
|
45
|
+
if !s || s.empty?
|
|
46
|
+
ds = ds.returning(*columns.map{|c| Sequel.identifier(c)})
|
|
49
47
|
end
|
|
50
48
|
|
|
51
49
|
prepare_statement(ds, type, vals)
|
|
@@ -70,9 +68,7 @@ module Sequel
|
|
|
70
68
|
# Return a prepared statement that can be used to insert a row using the given columns
|
|
71
69
|
# and return that column values for the row created.
|
|
72
70
|
def prepared_insert_select(cols)
|
|
73
|
-
|
|
74
|
-
cached_prepared_statement(:insert_select, prepared_columns(cols)){prepare_explicit_statement(naked.clone(:server=>dataset.opts.fetch(:server, :default)), :insert_select, prepared_statement_key_hash(cols))}
|
|
75
|
-
end
|
|
71
|
+
cached_prepared_statement(:insert_select, prepared_columns(cols)){prepare_explicit_statement(naked.clone(:server=>dataset.opts.fetch(:server, :default)), :insert_select, prepared_statement_key_hash(cols))}
|
|
76
72
|
end
|
|
77
73
|
|
|
78
74
|
# Return an array of two element arrays with the column symbol as the first entry and the
|
|
@@ -138,9 +134,7 @@ module Sequel
|
|
|
138
134
|
# and return the new column values.
|
|
139
135
|
def _insert_select_raw(ds)
|
|
140
136
|
if use_prepared_statements_for?(:insert_select)
|
|
141
|
-
|
|
142
|
-
_set_prepared_statement_server(ps).call(@values)
|
|
143
|
-
end
|
|
137
|
+
_set_prepared_statement_server(model.send(:prepared_insert_select, @values.keys)).call(@values)
|
|
144
138
|
else
|
|
145
139
|
super
|
|
146
140
|
end
|
|
@@ -66,9 +66,7 @@ module Sequel
|
|
|
66
66
|
# Merge the current values into the default values to reduce the number
|
|
67
67
|
# of free columns.
|
|
68
68
|
def before_create
|
|
69
|
-
|
|
70
|
-
@values = v.merge(values)
|
|
71
|
-
end
|
|
69
|
+
@values = model.prepared_statements_column_defaults.merge(@values)
|
|
72
70
|
super
|
|
73
71
|
end
|
|
74
72
|
|
|
@@ -192,23 +192,19 @@ module Sequel
|
|
|
192
192
|
:args=>((key_aliases + col_aliases) if col_aliases))
|
|
193
193
|
ds = r.apply_eager_dataset_changes(ds)
|
|
194
194
|
ds = ds.select_append(ka) unless ds.opts[:select] == nil
|
|
195
|
-
model.eager_load_results(r, eo.merge(:loader=>false, :
|
|
195
|
+
model.eager_load_results(r, eo.merge(:loader=>false, :initialize_rows=>false, :dataset=>ds, :id_map=>nil)) do |obj|
|
|
196
196
|
opk = prkey_conv[obj]
|
|
197
|
-
if parent_map
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
obj = idm_obj
|
|
201
|
-
end
|
|
197
|
+
if idm_obj = parent_map[opk]
|
|
198
|
+
key_aliases.each{|ka_| idm_obj.values[ka_] = obj.values[ka_]}
|
|
199
|
+
obj = idm_obj
|
|
202
200
|
else
|
|
203
201
|
obj.associations[parent] = nil
|
|
204
202
|
parent_map[opk] = obj
|
|
205
203
|
(children_map[key_conv[obj]] ||= []) << obj
|
|
206
204
|
end
|
|
207
205
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
root.associations[ancestors] << obj
|
|
211
|
-
end
|
|
206
|
+
id_map[extract_key_alias[obj]].each do |root|
|
|
207
|
+
root.associations[ancestors] << obj
|
|
212
208
|
end
|
|
213
209
|
end
|
|
214
210
|
parent_map.each do |parent_id, obj|
|
|
@@ -300,17 +296,15 @@ module Sequel
|
|
|
300
296
|
:args=>((key_aliases + col_aliases + (level ? [la] : [])) if col_aliases))
|
|
301
297
|
ds = r.apply_eager_dataset_changes(ds)
|
|
302
298
|
ds = ds.select_append(ka) unless ds.opts[:select] == nil
|
|
303
|
-
model.eager_load_results(r, eo.merge(:loader=>false, :
|
|
299
|
+
model.eager_load_results(r, eo.merge(:loader=>false, :initialize_rows=>false, :dataset=>ds, :id_map=>nil, :associations=>OPTS)) do |obj|
|
|
304
300
|
if level
|
|
305
301
|
no_cache = no_cache_level == obj.values.delete(la)
|
|
306
302
|
end
|
|
307
303
|
|
|
308
304
|
opk = prkey_conv[obj]
|
|
309
|
-
if parent_map
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
obj = idm_obj
|
|
313
|
-
end
|
|
305
|
+
if idm_obj = parent_map[opk]
|
|
306
|
+
key_aliases.each{|ka_| idm_obj.values[ka_] = obj.values[ka_]}
|
|
307
|
+
obj = idm_obj
|
|
314
308
|
else
|
|
315
309
|
obj.associations[childrena] = [] unless no_cache
|
|
316
310
|
parent_map[opk] = obj
|
|
@@ -163,21 +163,6 @@ module Sequel
|
|
|
163
163
|
super
|
|
164
164
|
end
|
|
165
165
|
|
|
166
|
-
# Copy the necessary attributes to the subclasses, and filter the
|
|
167
|
-
# subclass's dataset based on the sti_kep_map entry for the class.
|
|
168
|
-
def inherited(subclass)
|
|
169
|
-
super
|
|
170
|
-
key = Array(sti_key_map[subclass]).dup
|
|
171
|
-
sti_subclass_added(key)
|
|
172
|
-
rp = dataset.row_proc
|
|
173
|
-
subclass.set_dataset(sti_subclass_dataset(key), :inherited=>true)
|
|
174
|
-
subclass.instance_exec do
|
|
175
|
-
@dataset = @dataset.with_row_proc(rp)
|
|
176
|
-
@sti_key_array = key
|
|
177
|
-
self.simple_table = nil
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
|
|
181
166
|
# Return an instance of the class specified by sti_key,
|
|
182
167
|
# used by the row_proc.
|
|
183
168
|
def sti_load(r)
|
|
@@ -208,6 +193,21 @@ module Sequel
|
|
|
208
193
|
super
|
|
209
194
|
end
|
|
210
195
|
|
|
196
|
+
# Copy the necessary attributes to the subclasses, and filter the
|
|
197
|
+
# subclass's dataset based on the sti_kep_map entry for the class.
|
|
198
|
+
def inherited(subclass)
|
|
199
|
+
super
|
|
200
|
+
key = Array(sti_key_map[subclass]).dup
|
|
201
|
+
sti_subclass_added(key)
|
|
202
|
+
rp = dataset.row_proc
|
|
203
|
+
subclass.set_dataset(sti_subclass_dataset(key), :inherited=>true)
|
|
204
|
+
subclass.instance_exec do
|
|
205
|
+
@dataset = @dataset.with_row_proc(rp)
|
|
206
|
+
@sti_key_array = key
|
|
207
|
+
self.simple_table = nil
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
211
|
# If calling set_dataset manually, make sure to set the dataset
|
|
212
212
|
# row proc to one that handles inheritance correctly.
|
|
213
213
|
def set_dataset_row_proc(ds)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# frozen-string-literal: true
|
|
2
|
+
|
|
3
|
+
module Sequel
|
|
4
|
+
module Plugins
|
|
5
|
+
# The skip_saving_columms plugin allows skipping specific columns when
|
|
6
|
+
# saving. By default, it skips columns that the database schema
|
|
7
|
+
# indicates are generated columns:
|
|
8
|
+
#
|
|
9
|
+
# # Assume id column, name column, and id2 generated column
|
|
10
|
+
# album = Album[1]
|
|
11
|
+
# album.id # => 1
|
|
12
|
+
# album.name # => 'X'
|
|
13
|
+
# album.id2 # => 2
|
|
14
|
+
# album.save
|
|
15
|
+
# # UPDATE album SET name = 'X' WHERE (id = 1)
|
|
16
|
+
#
|
|
17
|
+
# You can override which columns will be skipped:
|
|
18
|
+
#
|
|
19
|
+
# Album.skip_saving_columns = [:name]
|
|
20
|
+
# album.save
|
|
21
|
+
# # UPDATE album SET id2 = 2 WHERE (id = 1)
|
|
22
|
+
#
|
|
23
|
+
# The skipping happens for all usage of Model#save and callers of it (e.g.
|
|
24
|
+
# Model.create, Model.update). When using the plugin, the only way to get
|
|
25
|
+
# it to save a column marked for skipping is to explicitly specify it:
|
|
26
|
+
#
|
|
27
|
+
# album.save(columns: [:name, :id2])
|
|
28
|
+
# album.save
|
|
29
|
+
# # UPDATE album SET name = 'X', id2 = 2 WHERE (id = 1)
|
|
30
|
+
#
|
|
31
|
+
# Usage:
|
|
32
|
+
#
|
|
33
|
+
# # Support skipping saving columns in all Sequel::Model subclasses
|
|
34
|
+
# # (called before loading subclasses)
|
|
35
|
+
# Sequel::Model.plugin :skip_saving_columns
|
|
36
|
+
#
|
|
37
|
+
# # Support skipping saving columns in the Album class
|
|
38
|
+
# Album.plugin :skip_saving_columns
|
|
39
|
+
module SkipSavingColumns
|
|
40
|
+
# Setup skipping of the generated columns for a model with an existing dataset.
|
|
41
|
+
def self.configure(mod)
|
|
42
|
+
mod.instance_exec do
|
|
43
|
+
set_skip_saving_generated_columns if @dataset
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
module ClassMethods
|
|
48
|
+
# An array of column symbols for columns to skip when saving.
|
|
49
|
+
attr_reader :skip_saving_columns
|
|
50
|
+
|
|
51
|
+
# Over the default array of columns to skip. Once overridden, future
|
|
52
|
+
# changes to the class's dataset and future subclasses will automatically
|
|
53
|
+
# use these overridden columns, instead of introspecting the database schema.
|
|
54
|
+
def skip_saving_columns=(v)
|
|
55
|
+
@_skip_saving_columns_no_override = true
|
|
56
|
+
@skip_saving_columns = v.dup.freeze
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
Plugins.after_set_dataset(self, :set_skip_saving_generated_columns)
|
|
60
|
+
Plugins.inherited_instance_variables(self, :@skip_saving_columns=>:dup, :@_skip_saving_columns_no_override=>nil)
|
|
61
|
+
|
|
62
|
+
private
|
|
63
|
+
|
|
64
|
+
# If the skip saving columns has not been overridden, check the database
|
|
65
|
+
# schema and automatically skip any generated columns.
|
|
66
|
+
def set_skip_saving_generated_columns
|
|
67
|
+
return if @_skip_saving_columns_no_override
|
|
68
|
+
s = []
|
|
69
|
+
db_schema.each do |k, v|
|
|
70
|
+
s << k if v[:generated]
|
|
71
|
+
end
|
|
72
|
+
@skip_saving_columns = s.freeze
|
|
73
|
+
nil
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
module InstanceMethods
|
|
78
|
+
private
|
|
79
|
+
|
|
80
|
+
# Skip the columns the model has marked to skip when inserting.
|
|
81
|
+
def _insert_values
|
|
82
|
+
_save_removed_skipped_columns(Hash[super])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Skip the columns the model has marked to skip when updating
|
|
86
|
+
# all columns.
|
|
87
|
+
def _save_update_all_columns_hash
|
|
88
|
+
_save_removed_skipped_columns(super)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Skip the columns the model has marked to skip when updating
|
|
92
|
+
# only changed columns.
|
|
93
|
+
def _save_update_changed_colums_hash
|
|
94
|
+
_save_removed_skipped_columns(super)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Remove any columns the model has marked to skip when saving.
|
|
98
|
+
def _save_removed_skipped_columns(hash)
|
|
99
|
+
model.skip_saving_columns.each do |column|
|
|
100
|
+
hash.delete(column)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
hash
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
@@ -28,7 +28,7 @@ module Sequel
|
|
|
28
28
|
model.plugin(:input_transformer, :string_stripper){|v| (v.is_a?(String) && !v.is_a?(SQL::Blob)) ? v.strip : v}
|
|
29
29
|
end
|
|
30
30
|
def self.configure(model)
|
|
31
|
-
model.
|
|
31
|
+
model.send(:set_skipped_string_stripping_columns)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
module ClassMethods
|
|
@@ -63,6 +63,8 @@ module Sequel
|
|
|
63
63
|
|
|
64
64
|
Plugins.inherited_instance_variables(self, :@subclasses=>lambda{|v| []}, :@on_subclass=>nil)
|
|
65
65
|
|
|
66
|
+
private
|
|
67
|
+
|
|
66
68
|
# Add the subclass to this model's current subclasses,
|
|
67
69
|
# and initialize a new subclasses instance variable
|
|
68
70
|
# in the subclass.
|
|
@@ -194,7 +194,11 @@ module Sequel
|
|
|
194
194
|
def validates_each(*atts, &block)
|
|
195
195
|
opts = extract_options!(atts)
|
|
196
196
|
blank_meth = db.method(:blank_object?).to_proc
|
|
197
|
-
|
|
197
|
+
i = opts[:if]
|
|
198
|
+
am = opts[:allow_missing]
|
|
199
|
+
an = opts[:allow_nil]
|
|
200
|
+
ab = opts[:allow_blank]
|
|
201
|
+
blk = if i || am || an || ab
|
|
198
202
|
if i.is_a?(Proc)
|
|
199
203
|
i = Plugins.def_sequel_method(self, "validation_class_methods_if", 0, &i)
|
|
200
204
|
end
|
data/lib/sequel/timezones.rb
CHANGED
|
@@ -4,6 +4,11 @@ module Sequel
|
|
|
4
4
|
@application_timezone = nil
|
|
5
5
|
@database_timezone = nil
|
|
6
6
|
@typecast_timezone = nil
|
|
7
|
+
@local_offsets = {}
|
|
8
|
+
|
|
9
|
+
# Backwards compatible alias
|
|
10
|
+
Timezones = SequelMethods
|
|
11
|
+
Deprecation.deprecate_constant(self, :Timezones)
|
|
7
12
|
|
|
8
13
|
# Sequel doesn't pay much attention to timezones by default, but you can set it
|
|
9
14
|
# handle timezones if you want. There are three separate timezone settings, application_timezone,
|
|
@@ -16,7 +21,7 @@ module Sequel
|
|
|
16
21
|
# on the environment (e.g. current user), you need to use the +named_timezones+ extension (and use
|
|
17
22
|
# +DateTime+ as the +datetime_class+). Sequel also ships with a +thread_local_timezones+ extensions
|
|
18
23
|
# which allows each thread to have its own timezone values for each of the timezones.
|
|
19
|
-
module
|
|
24
|
+
module SequelMethods
|
|
20
25
|
# The timezone you want the application to use. This is the timezone
|
|
21
26
|
# that incoming times from the database and typecasting are converted to.
|
|
22
27
|
attr_reader :application_timezone
|
|
@@ -243,7 +248,4 @@ module Sequel
|
|
|
243
248
|
Sequel.synchronize{@local_offsets[offset_secs] = Rational(offset_secs, 86400)}
|
|
244
249
|
end
|
|
245
250
|
end
|
|
246
|
-
|
|
247
|
-
@local_offsets = {}
|
|
248
|
-
extend Timezones
|
|
249
251
|
end
|
data/lib/sequel/version.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Sequel
|
|
|
6
6
|
|
|
7
7
|
# The minor version of Sequel. Bumped for every non-patch level
|
|
8
8
|
# release, generally around once a month.
|
|
9
|
-
MINOR =
|
|
9
|
+
MINOR = 35
|
|
10
10
|
|
|
11
11
|
# The tiny version of Sequel. Usually 0, only bumped for bugfix
|
|
12
12
|
# releases that fix regressions from previous versions.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sequel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.35.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-08-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|
|
@@ -178,6 +178,11 @@ extra_rdoc_files:
|
|
|
178
178
|
- doc/release_notes/5.28.0.txt
|
|
179
179
|
- doc/release_notes/5.29.0.txt
|
|
180
180
|
- doc/release_notes/5.30.0.txt
|
|
181
|
+
- doc/release_notes/5.31.0.txt
|
|
182
|
+
- doc/release_notes/5.32.0.txt
|
|
183
|
+
- doc/release_notes/5.33.0.txt
|
|
184
|
+
- doc/release_notes/5.34.0.txt
|
|
185
|
+
- doc/release_notes/5.35.0.txt
|
|
181
186
|
files:
|
|
182
187
|
- CHANGELOG
|
|
183
188
|
- MIT-LICENSE
|
|
@@ -229,6 +234,11 @@ files:
|
|
|
229
234
|
- doc/release_notes/5.29.0.txt
|
|
230
235
|
- doc/release_notes/5.3.0.txt
|
|
231
236
|
- doc/release_notes/5.30.0.txt
|
|
237
|
+
- doc/release_notes/5.31.0.txt
|
|
238
|
+
- doc/release_notes/5.32.0.txt
|
|
239
|
+
- doc/release_notes/5.33.0.txt
|
|
240
|
+
- doc/release_notes/5.34.0.txt
|
|
241
|
+
- doc/release_notes/5.35.0.txt
|
|
232
242
|
- doc/release_notes/5.4.0.txt
|
|
233
243
|
- doc/release_notes/5.5.0.txt
|
|
234
244
|
- doc/release_notes/5.6.0.txt
|
|
@@ -348,6 +358,7 @@ files:
|
|
|
348
358
|
- lib/sequel/extensions/escaped_like.rb
|
|
349
359
|
- lib/sequel/extensions/eval_inspect.rb
|
|
350
360
|
- lib/sequel/extensions/exclude_or_null.rb
|
|
361
|
+
- lib/sequel/extensions/fiber_concurrency.rb
|
|
351
362
|
- lib/sequel/extensions/freeze_datasets.rb
|
|
352
363
|
- lib/sequel/extensions/from_block.rb
|
|
353
364
|
- lib/sequel/extensions/graph_each.rb
|
|
@@ -384,6 +395,7 @@ files:
|
|
|
384
395
|
- lib/sequel/extensions/pretty_table.rb
|
|
385
396
|
- lib/sequel/extensions/query.rb
|
|
386
397
|
- lib/sequel/extensions/round_timestamps.rb
|
|
398
|
+
- lib/sequel/extensions/run_transaction_hooks.rb
|
|
387
399
|
- lib/sequel/extensions/s.rb
|
|
388
400
|
- lib/sequel/extensions/schema_caching.rb
|
|
389
401
|
- lib/sequel/extensions/schema_dumper.rb
|
|
@@ -417,6 +429,7 @@ files:
|
|
|
417
429
|
- lib/sequel/plugins/active_model.rb
|
|
418
430
|
- lib/sequel/plugins/after_initialize.rb
|
|
419
431
|
- lib/sequel/plugins/association_dependencies.rb
|
|
432
|
+
- lib/sequel/plugins/association_lazy_eager_option.rb
|
|
420
433
|
- lib/sequel/plugins/association_multi_add_remove.rb
|
|
421
434
|
- lib/sequel/plugins/association_pks.rb
|
|
422
435
|
- lib/sequel/plugins/association_proxies.rb
|
|
@@ -443,6 +456,7 @@ files:
|
|
|
443
456
|
- lib/sequel/plugins/empty_failure_backtraces.rb
|
|
444
457
|
- lib/sequel/plugins/error_splitter.rb
|
|
445
458
|
- lib/sequel/plugins/finder.rb
|
|
459
|
+
- lib/sequel/plugins/forbid_lazy_load.rb
|
|
446
460
|
- lib/sequel/plugins/force_encoding.rb
|
|
447
461
|
- lib/sequel/plugins/hook_class_methods.rb
|
|
448
462
|
- lib/sequel/plugins/input_transformer.rb
|
|
@@ -450,6 +464,7 @@ files:
|
|
|
450
464
|
- lib/sequel/plugins/insert_returning_select.rb
|
|
451
465
|
- lib/sequel/plugins/instance_filters.rb
|
|
452
466
|
- lib/sequel/plugins/instance_hooks.rb
|
|
467
|
+
- lib/sequel/plugins/instance_specific_default.rb
|
|
453
468
|
- lib/sequel/plugins/inverted_subsets.rb
|
|
454
469
|
- lib/sequel/plugins/json_serializer.rb
|
|
455
470
|
- lib/sequel/plugins/lazy_attributes.rb
|
|
@@ -471,6 +486,7 @@ files:
|
|
|
471
486
|
- lib/sequel/plugins/single_table_inheritance.rb
|
|
472
487
|
- lib/sequel/plugins/singular_table_names.rb
|
|
473
488
|
- lib/sequel/plugins/skip_create_refresh.rb
|
|
489
|
+
- lib/sequel/plugins/skip_saving_columns.rb
|
|
474
490
|
- lib/sequel/plugins/split_values.rb
|
|
475
491
|
- lib/sequel/plugins/static_cache.rb
|
|
476
492
|
- lib/sequel/plugins/static_cache_cache.rb
|