sequel 4.5.0 → 4.6.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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +14 -0
  3. data/README.rdoc +0 -1
  4. data/doc/mssql_stored_procedures.rdoc +43 -0
  5. data/doc/release_notes/3.18.0.txt +2 -3
  6. data/doc/release_notes/3.9.0.txt +1 -1
  7. data/doc/release_notes/4.6.0.txt +30 -0
  8. data/doc/security.rdoc +7 -0
  9. data/lib/sequel/adapters/jdbc/h2.rb +4 -4
  10. data/lib/sequel/adapters/jdbc/postgresql.rb +4 -0
  11. data/lib/sequel/adapters/oracle.rb +1 -0
  12. data/lib/sequel/adapters/shared/mssql.rb +94 -1
  13. data/lib/sequel/adapters/shared/mysql.rb +4 -4
  14. data/lib/sequel/adapters/shared/postgres.rb +4 -4
  15. data/lib/sequel/adapters/tinytds.rb +22 -4
  16. data/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +8 -2
  17. data/lib/sequel/database/dataset_defaults.rb +1 -1
  18. data/lib/sequel/model/associations.rb +1 -1
  19. data/lib/sequel/version.rb +1 -1
  20. data/spec/adapters/mssql_spec.rb +35 -0
  21. data/spec/adapters/oracle_spec.rb +4 -4
  22. data/spec/adapters/postgres_spec.rb +93 -93
  23. data/spec/adapters/spec_helper.rb +3 -1
  24. data/spec/bin_spec.rb +2 -0
  25. data/spec/core/database_spec.rb +22 -22
  26. data/spec/core/dataset_spec.rb +8 -8
  27. data/spec/core/expression_filters_spec.rb +1 -1
  28. data/spec/core/mock_adapter_spec.rb +2 -2
  29. data/spec/core/schema_generator_spec.rb +3 -3
  30. data/spec/core/spec_helper.rb +3 -1
  31. data/spec/core_extensions_spec.rb +3 -1
  32. data/spec/extensions/auto_validations_spec.rb +17 -17
  33. data/spec/extensions/caching_spec.rb +4 -4
  34. data/spec/extensions/error_splitter_spec.rb +1 -1
  35. data/spec/extensions/hook_class_methods_spec.rb +6 -6
  36. data/spec/extensions/migration_spec.rb +53 -53
  37. data/spec/extensions/pagination_spec.rb +9 -9
  38. data/spec/extensions/pg_array_associations_spec.rb +2 -2
  39. data/spec/extensions/pg_array_spec.rb +2 -2
  40. data/spec/extensions/pg_hstore_spec.rb +15 -15
  41. data/spec/extensions/pg_interval_spec.rb +3 -3
  42. data/spec/extensions/pg_range_spec.rb +20 -20
  43. data/spec/extensions/pg_row_spec.rb +1 -1
  44. data/spec/extensions/schema_caching_spec.rb +3 -3
  45. data/spec/extensions/spec_helper.rb +3 -1
  46. data/spec/extensions/static_cache_spec.rb +16 -16
  47. data/spec/extensions/tree_spec.rb +8 -8
  48. data/spec/extensions/validation_class_methods_spec.rb +10 -10
  49. data/spec/integration/database_test.rb +3 -3
  50. data/spec/integration/dataset_test.rb +6 -0
  51. data/spec/integration/migrator_test.rb +67 -67
  52. data/spec/integration/model_test.rb +2 -2
  53. data/spec/integration/schema_test.rb +1 -1
  54. data/spec/integration/spec_helper.rb +3 -1
  55. data/spec/integration/transaction_test.rb +2 -2
  56. data/spec/model/association_reflection_spec.rb +4 -4
  57. data/spec/model/associations_spec.rb +1 -1
  58. data/spec/model/class_dataset_methods_spec.rb +1 -1
  59. data/spec/model/eager_loading_spec.rb +7 -0
  60. data/spec/model/model_spec.rb +4 -4
  61. data/spec/model/record_spec.rb +20 -20
  62. data/spec/model/spec_helper.rb +2 -1
  63. data/spec/model/validations_spec.rb +1 -1
  64. data/spec/rspec_helper.rb +18 -0
  65. metadata +8 -3
@@ -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 be_true
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 be_true
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 be_true
378
- @o.changed_columns.frozen?.should be_true
379
- @o.errors.frozen?.should be_true
380
- @o.this.frozen?.should be_true
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 be_false
389
- Album.new.freeze.new?.should be_true
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 be_true
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 be_false
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 be_false
434
- @Album.new.dup.new?.should be_true
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 be_false
471
- @Album.new.clone.new?.should be_true
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 be_false
569
+ o.modified?(:id).should == false
570
570
  o.id = 1
571
- o.modified?(:id).should be_true
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 be_true
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 be_true
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 be_false
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 be_false
1322
+ @model.new.exists?.should == false
1323
1323
  DB.sqls.should == []
1324
1324
  end
1325
1325
  end
@@ -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
- (defined?(RSpec) ? RSpec::Core::ExampleGroup : Spec::Example::ExampleGroup).class_eval do
10
+ RSPEC_EXAMPLE_GROUP.class_eval do
10
11
  if ENV['SEQUEL_DEPRECATION_WARNINGS']
11
12
  class << self
12
13
  alias qspecify specify
@@ -161,7 +161,7 @@ describe "Model#save" do
161
161
 
162
162
  @m.x = 7
163
163
  @m.should be_valid
164
- @m.save.should_not be_false
164
+ @m.save.should_not == false
165
165
  DB.sqls.should == ['UPDATE people SET x = 7 WHERE (id = 4)']
166
166
  end
167
167
 
@@ -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.5.0
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: 2013-12-02 00:00:00.000000000 Z
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.3
691
+ rubygems_version: 2.0.14
687
692
  signing_key:
688
693
  specification_version: 4
689
694
  summary: The Database Toolkit for Ruby