sequel 4.5.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +14 -0
- data/README.rdoc +0 -1
- data/doc/mssql_stored_procedures.rdoc +43 -0
- data/doc/release_notes/3.18.0.txt +2 -3
- data/doc/release_notes/3.9.0.txt +1 -1
- data/doc/release_notes/4.6.0.txt +30 -0
- data/doc/security.rdoc +7 -0
- data/lib/sequel/adapters/jdbc/h2.rb +4 -4
- data/lib/sequel/adapters/jdbc/postgresql.rb +4 -0
- data/lib/sequel/adapters/oracle.rb +1 -0
- data/lib/sequel/adapters/shared/mssql.rb +94 -1
- data/lib/sequel/adapters/shared/mysql.rb +4 -4
- data/lib/sequel/adapters/shared/postgres.rb +4 -4
- data/lib/sequel/adapters/tinytds.rb +22 -4
- data/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +8 -2
- data/lib/sequel/database/dataset_defaults.rb +1 -1
- data/lib/sequel/model/associations.rb +1 -1
- data/lib/sequel/version.rb +1 -1
- data/spec/adapters/mssql_spec.rb +35 -0
- data/spec/adapters/oracle_spec.rb +4 -4
- data/spec/adapters/postgres_spec.rb +93 -93
- data/spec/adapters/spec_helper.rb +3 -1
- data/spec/bin_spec.rb +2 -0
- data/spec/core/database_spec.rb +22 -22
- data/spec/core/dataset_spec.rb +8 -8
- data/spec/core/expression_filters_spec.rb +1 -1
- data/spec/core/mock_adapter_spec.rb +2 -2
- data/spec/core/schema_generator_spec.rb +3 -3
- data/spec/core/spec_helper.rb +3 -1
- data/spec/core_extensions_spec.rb +3 -1
- data/spec/extensions/auto_validations_spec.rb +17 -17
- data/spec/extensions/caching_spec.rb +4 -4
- data/spec/extensions/error_splitter_spec.rb +1 -1
- data/spec/extensions/hook_class_methods_spec.rb +6 -6
- data/spec/extensions/migration_spec.rb +53 -53
- data/spec/extensions/pagination_spec.rb +9 -9
- data/spec/extensions/pg_array_associations_spec.rb +2 -2
- data/spec/extensions/pg_array_spec.rb +2 -2
- data/spec/extensions/pg_hstore_spec.rb +15 -15
- data/spec/extensions/pg_interval_spec.rb +3 -3
- data/spec/extensions/pg_range_spec.rb +20 -20
- data/spec/extensions/pg_row_spec.rb +1 -1
- data/spec/extensions/schema_caching_spec.rb +3 -3
- data/spec/extensions/spec_helper.rb +3 -1
- data/spec/extensions/static_cache_spec.rb +16 -16
- data/spec/extensions/tree_spec.rb +8 -8
- data/spec/extensions/validation_class_methods_spec.rb +10 -10
- data/spec/integration/database_test.rb +3 -3
- data/spec/integration/dataset_test.rb +6 -0
- data/spec/integration/migrator_test.rb +67 -67
- data/spec/integration/model_test.rb +2 -2
- data/spec/integration/schema_test.rb +1 -1
- data/spec/integration/spec_helper.rb +3 -1
- data/spec/integration/transaction_test.rb +2 -2
- data/spec/model/association_reflection_spec.rb +4 -4
- data/spec/model/associations_spec.rb +1 -1
- data/spec/model/class_dataset_methods_spec.rb +1 -1
- data/spec/model/eager_loading_spec.rb +7 -0
- data/spec/model/model_spec.rb +4 -4
- data/spec/model/record_spec.rb +20 -20
- data/spec/model/spec_helper.rb +2 -1
- data/spec/model/validations_spec.rb +1 -1
- data/spec/rspec_helper.rb +18 -0
- metadata +8 -3
data/spec/model/record_spec.rb
CHANGED
@@ -364,20 +364,20 @@ describe "Model#freeze" do
|
|
364
364
|
end
|
365
365
|
|
366
366
|
it "should freeze the object" do
|
367
|
-
@o.frozen?.should
|
367
|
+
@o.frozen?.should == true
|
368
368
|
end
|
369
369
|
|
370
370
|
it "should freeze the object if the model doesn't have a primary key" do
|
371
371
|
Album.no_primary_key
|
372
372
|
@o = Album.load(:id=>1).freeze
|
373
|
-
@o.frozen?.should
|
373
|
+
@o.frozen?.should == true
|
374
374
|
end
|
375
375
|
|
376
376
|
it "should freeze the object's values, associations, changed_columns, errors, and this" do
|
377
|
-
@o.values.frozen?.should
|
378
|
-
@o.changed_columns.frozen?.should
|
379
|
-
@o.errors.frozen?.should
|
380
|
-
@o.this.frozen?.should
|
377
|
+
@o.values.frozen?.should == true
|
378
|
+
@o.changed_columns.frozen?.should == true
|
379
|
+
@o.errors.frozen?.should == true
|
380
|
+
@o.this.frozen?.should == true
|
381
381
|
end
|
382
382
|
|
383
383
|
it "should still have working class attr overriddable methods" do
|
@@ -385,16 +385,16 @@ describe "Model#freeze" do
|
|
385
385
|
end
|
386
386
|
|
387
387
|
it "should have working new? method" do
|
388
|
-
@o.new?.should
|
389
|
-
Album.new.freeze.new?.should
|
388
|
+
@o.new?.should == false
|
389
|
+
Album.new.freeze.new?.should == true
|
390
390
|
end
|
391
391
|
|
392
392
|
it "should have working valid? method" do
|
393
|
-
@o.valid?.should
|
393
|
+
@o.valid?.should == true
|
394
394
|
o = Album.new
|
395
395
|
def o.validate() errors.add(:foo, '') end
|
396
396
|
o.freeze
|
397
|
-
o.valid?.should
|
397
|
+
o.valid?.should == false
|
398
398
|
end
|
399
399
|
|
400
400
|
it "should raise an Error if trying to save/destroy/delete/refresh" do
|
@@ -430,8 +430,8 @@ describe "Model#dup" do
|
|
430
430
|
end
|
431
431
|
|
432
432
|
it "should keep new status" do
|
433
|
-
@o.dup.new?.should
|
434
|
-
@Album.new.dup.new?.should
|
433
|
+
@o.dup.new?.should == false
|
434
|
+
@Album.new.dup.new?.should == true
|
435
435
|
end
|
436
436
|
|
437
437
|
it "should not copy frozen status" do
|
@@ -467,8 +467,8 @@ describe "Model#clone" do
|
|
467
467
|
end
|
468
468
|
|
469
469
|
it "should keep new status" do
|
470
|
-
@o.clone.new?.should
|
471
|
-
@Album.new.clone.new?.should
|
470
|
+
@o.clone.new?.should == false
|
471
|
+
@Album.new.clone.new?.should == true
|
472
472
|
end
|
473
473
|
|
474
474
|
it "should copy frozen status" do
|
@@ -566,9 +566,9 @@ describe "Model#modified?" do
|
|
566
566
|
|
567
567
|
it "should be true if given a column argument and the column has been changed" do
|
568
568
|
o = @c.new
|
569
|
-
o.modified?(:id).should
|
569
|
+
o.modified?(:id).should == false
|
570
570
|
o.id = 1
|
571
|
-
o.modified?(:id).should
|
571
|
+
o.modified?(:id).should == true
|
572
572
|
end
|
573
573
|
end
|
574
574
|
|
@@ -1182,7 +1182,7 @@ describe Sequel::Model, "#(set|update)_(all|only)" do
|
|
1182
1182
|
|
1183
1183
|
it "#set_all should set not set restricted fields" do
|
1184
1184
|
@o1.set_all(:x => 1, :use_after_commit_rollback => false)
|
1185
|
-
@o1.use_after_commit_rollback.should
|
1185
|
+
@o1.use_after_commit_rollback.should == true
|
1186
1186
|
@o1.values.should == {:x => 1}
|
1187
1187
|
end
|
1188
1188
|
|
@@ -1309,17 +1309,17 @@ describe Sequel::Model, "#exists?" do
|
|
1309
1309
|
end
|
1310
1310
|
|
1311
1311
|
it "should do a query to check if the record exists" do
|
1312
|
-
@model.load(:id=>1).exists?.should
|
1312
|
+
@model.load(:id=>1).exists?.should == true
|
1313
1313
|
DB.sqls.should == ['SELECT 1 AS one FROM items WHERE (id = 1) LIMIT 1']
|
1314
1314
|
end
|
1315
1315
|
|
1316
1316
|
it "should return false when #this.count == 0" do
|
1317
|
-
@model.load(:id=>2).exists?.should
|
1317
|
+
@model.load(:id=>2).exists?.should == false
|
1318
1318
|
DB.sqls.should == ['SELECT 1 AS one FROM items WHERE (id = 2) LIMIT 1']
|
1319
1319
|
end
|
1320
1320
|
|
1321
1321
|
it "should return false without issuing a query if the model object is new" do
|
1322
|
-
@model.new.exists?.should
|
1322
|
+
@model.new.exists?.should == false
|
1323
1323
|
DB.sqls.should == []
|
1324
1324
|
end
|
1325
1325
|
end
|
data/spec/model/spec_helper.rb
CHANGED
@@ -5,8 +5,9 @@ unless Object.const_defined?('Sequel') && Sequel.const_defined?('Model')
|
|
5
5
|
end
|
6
6
|
Sequel::Deprecation.backtrace_filter = lambda{|line, lineno| lineno < 4 || line =~ /_spec\.rb/}
|
7
7
|
|
8
|
+
require File.join(File.dirname(File.expand_path(__FILE__)), "../rspec_helper.rb")
|
8
9
|
|
9
|
-
|
10
|
+
RSPEC_EXAMPLE_GROUP.class_eval do
|
10
11
|
if ENV['SEQUEL_DEPRECATION_WARNINGS']
|
11
12
|
class << self
|
12
13
|
alias qspecify specify
|
@@ -0,0 +1,18 @@
|
|
1
|
+
unless defined?(RSPEC_EXAMPLE_GROUP)
|
2
|
+
if defined?(RSpec)
|
3
|
+
require 'rspec/version'
|
4
|
+
if RSpec::Version::STRING >= '2.11.0'
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.expect_with :rspec do |c|
|
7
|
+
c.syntax = :should
|
8
|
+
end
|
9
|
+
config.mock_with :rspec do |c|
|
10
|
+
c.syntax = :should
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
RSPEC_EXAMPLE_GROUP = RSpec::Core::ExampleGroup
|
15
|
+
else
|
16
|
+
RSPEC_EXAMPLE_GROUP = Spec::Example::ExampleGroup
|
17
|
+
end
|
18
|
+
end
|
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: 4.
|
4
|
+
version: 4.6.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:
|
11
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The Database Toolkit for Ruby
|
14
14
|
email: code@jeremyevans.net
|
@@ -48,6 +48,7 @@ extra_rdoc_files:
|
|
48
48
|
- doc/code_order.rdoc
|
49
49
|
- doc/model_plugins.rdoc
|
50
50
|
- doc/extensions.rdoc
|
51
|
+
- doc/mssql_stored_procedures.rdoc
|
51
52
|
- doc/release_notes/1.0.txt
|
52
53
|
- doc/release_notes/1.1.txt
|
53
54
|
- doc/release_notes/1.3.txt
|
@@ -121,6 +122,7 @@ extra_rdoc_files:
|
|
121
122
|
- doc/release_notes/4.3.0.txt
|
122
123
|
- doc/release_notes/4.4.0.txt
|
123
124
|
- doc/release_notes/4.5.0.txt
|
125
|
+
- doc/release_notes/4.6.0.txt
|
124
126
|
files:
|
125
127
|
- MIT-LICENSE
|
126
128
|
- CHANGELOG
|
@@ -156,6 +158,7 @@ files:
|
|
156
158
|
- doc/code_order.rdoc
|
157
159
|
- doc/model_plugins.rdoc
|
158
160
|
- doc/extensions.rdoc
|
161
|
+
- doc/mssql_stored_procedures.rdoc
|
159
162
|
- doc/release_notes/1.0.txt
|
160
163
|
- doc/release_notes/1.1.txt
|
161
164
|
- doc/release_notes/1.3.txt
|
@@ -229,6 +232,7 @@ files:
|
|
229
232
|
- doc/release_notes/4.3.0.txt
|
230
233
|
- doc/release_notes/4.4.0.txt
|
231
234
|
- doc/release_notes/4.5.0.txt
|
235
|
+
- doc/release_notes/4.6.0.txt
|
232
236
|
- spec/adapters/firebird_spec.rb
|
233
237
|
- spec/adapters/informix_spec.rb
|
234
238
|
- spec/adapters/mssql_spec.rb
|
@@ -430,6 +434,7 @@ files:
|
|
430
434
|
- spec/core_extensions_spec.rb
|
431
435
|
- spec/sequel_coverage.rb
|
432
436
|
- spec/bin_spec.rb
|
437
|
+
- spec/rspec_helper.rb
|
433
438
|
- spec/files/uppercase_timestamped_migrations/1273253849_CREATE_SESSIONS.RB
|
434
439
|
- spec/files/uppercase_timestamped_migrations/1273253851_CREATE_NODES.RB
|
435
440
|
- spec/files/uppercase_timestamped_migrations/1273253853_3_CREATE_USERS.RB
|
@@ -683,7 +688,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
683
688
|
version: '0'
|
684
689
|
requirements: []
|
685
690
|
rubyforge_project:
|
686
|
-
rubygems_version: 2.0.
|
691
|
+
rubygems_version: 2.0.14
|
687
692
|
signing_key:
|
688
693
|
specification_version: 4
|
689
694
|
summary: The Database Toolkit for Ruby
|