activerecord-oracle_enhanced-adapter 1.7.6 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41a3067381d41d5b5913b9a33068ba104b6a2dcf
4
- data.tar.gz: be09e20a6bed6f6f809fc91c44b64123cc0401e9
3
+ metadata.gz: fa268d433a58212089a08ecef9e43c163abde038
4
+ data.tar.gz: 4c57883d8eaa819b01c58342cd1d1ef679228f46
5
5
  SHA512:
6
- metadata.gz: 77e99c43c30fa4af329f92125d678a96250e5321b9bbd4df76555dbdf80d42dff2a779fdb43aa262dd01a493120a28bfd4113fa90b015c0e6f412c41d40a1da5
7
- data.tar.gz: 3baf365a33a66438a8c6d1177baf2d499d944c0f85c261e7d486f8288a69578f018be54db571c33f5fbcea8c15be8cc35bc198279dfb459d2e8cc682fb4abef1
6
+ metadata.gz: e5f806719336de611f0b0665c16ed334c35c544f2e6b9462e2e6788f41417f33e43b524769c47bc6b1b6bb67c47316c2ac84b69132f6e3253f1d32d6d5f72441
7
+ data.tar.gz: 03f58f1cbdec17d82868588f78f1dd26cf6532ec819410f7c0d0cdd17a4611dee283bb55f2496befba03b9e37fe13ede1cff77b5792e9fd1ef87c49bf6110caf
data/History.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.7.7 / 2016-11-15
2
+
3
+ * Changes and bug fixes
4
+ * Introduce `use_old_oracle_visitor` to choose old Oracle visitor [#1049]
5
+ * Fix deprecated warnings in Ruby 2.4.0+ [#1048, #1052]
6
+ * Add Ruby 2.2.5 and JRuby 9.0.5.0 for travis [#1050, #1051]
7
+
8
+ * Known issues
9
+ * No changes since 1.7.6
10
+
1
11
  ## 1.7.6 / 2016-11-12
2
12
 
3
13
  * Changes and bug fixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.6
1
+ 1.7.7
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{activerecord-oracle_enhanced-adapter}
3
- s.version = "1.7.6"
3
+ s.version = "1.7.7"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.required_ruby_version = '>= 2.2.2'
7
7
  s.license = 'MIT'
8
8
  s.authors = [%q{Raimonds Simanovskis}]
9
- s.date = %q{2016-11-12}
9
+ s.date = %q{2016-11-15}
10
10
  s.description = %q{Oracle "enhanced" ActiveRecord adapter contains useful additional methods for working with new and legacy Oracle databases.
11
11
  This adapter is superset of original ActiveRecord Oracle adapter.
12
12
  }
@@ -250,12 +250,12 @@ module ActiveRecord
250
250
 
251
251
  def typecast_result_value(value, get_lob_value)
252
252
  case value
253
- when Fixnum, Bignum
253
+ when Integer
254
254
  value
255
255
  when String
256
256
  value
257
257
  when Float, BigDecimal
258
- # return Fixnum or Bignum if value is integer (to avoid issues with _before_type_cast values for id attributes)
258
+ # return Integer if value is integer (to avoid issues with _before_type_cast values for id attributes)
259
259
  value == (v_to_i = value.to_i) ? v_to_i : value
260
260
  when OraNumber
261
261
  # change OraNumber value (returned in early versions of ruby-oci8 2.0.x) to BigDecimal
@@ -390,6 +390,17 @@ module ActiveRecord
390
390
  cattr_accessor :string_to_time_format
391
391
  self.string_to_time_format = nil
392
392
 
393
+ ##
394
+ # :singleton-method:
395
+ # By default, OracleEnhanced adapter will use Oracle12 visitor
396
+ # if database version is Oracle 12.1.
397
+ # If you wish to use Oracle visitor which is intended to work with Oracle 11.2 or lower
398
+ # for Oracle 12.1 database you can add the following line to your initializer file:
399
+ #
400
+ # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.use_old_oracle_visitor = true
401
+ cattr_accessor :use_old_oracle_visitor
402
+ self.use_old_oracle_visitor = false
403
+
393
404
  class StatementPool
394
405
  include Enumerable
395
406
 
@@ -434,7 +445,7 @@ module ActiveRecord
434
445
  end
435
446
 
436
447
  def arel_visitor # :nodoc:
437
- if supports_fetch_first_n_rows_and_offset?
448
+ if supports_fetch_first_n_rows_and_offset? && !use_old_oracle_visitor
438
449
  Arel::Visitors::Oracle12.new(self)
439
450
  else
440
451
  Arel::Visitors::Oracle.new(self)
@@ -206,19 +206,19 @@ describe "OracleEnhancedAdapter integer type detection based on column names" do
206
206
  expect(@employee2.job_id.class).to eq(BigDecimal)
207
207
  end
208
208
 
209
- it "should return Fixnum value from NUMBER column if column name contains 'id' and emulate_integers_by_column_name is true" do
209
+ it "should return Integer value from NUMBER column if column name contains 'id' and emulate_integers_by_column_name is true" do
210
210
  # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_integers_by_column_name = true
211
211
  class ::Test2Employee < ActiveRecord::Base
212
212
  attribute :job_id, :integer
213
213
  end
214
214
  create_employee2
215
- expect(@employee2.job_id.class).to eq(Fixnum)
215
+ expect(@employee2.job_id).to be_a(Integer)
216
216
  end
217
217
 
218
- it "should return Fixnum value from NUMBER column with integer value using _before_type_cast method" do
218
+ it "should return Integer value from NUMBER column with integer value using _before_type_cast method" do
219
219
  # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_integers_by_column_name = true
220
220
  create_employee2
221
- expect(@employee2.job_id_before_type_cast.class).to eq(Fixnum)
221
+ expect(@employee2.job_id_before_type_cast).to be_a(Integer)
222
222
  end
223
223
 
224
224
  it "should return BigDecimal value from NUMBER column if column name does not contain 'id' and emulate_integers_by_column_name is true" do
@@ -227,14 +227,14 @@ describe "OracleEnhancedAdapter integer type detection based on column names" do
227
227
  expect(@employee2.salary.class).to eq(BigDecimal)
228
228
  end
229
229
 
230
- it "should return Fixnum value from NUMBER column if column specified in set_integer_columns" do
230
+ it "should return Integer value from NUMBER column if column specified in set_integer_columns" do
231
231
  # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_integers_by_column_name = false
232
232
  # Test2Employee.set_integer_columns :job_id
233
233
  class ::Test2Employee < ActiveRecord::Base
234
234
  attribute :job_id, :integer
235
235
  end
236
236
  create_employee2
237
- expect(@employee2.job_id.class).to eq(Fixnum)
237
+ expect(@employee2.job_id).to be_a(Integer)
238
238
  end
239
239
 
240
240
  it "should return Boolean value from NUMBER(1) column if emulate booleans is used" do
@@ -243,23 +243,23 @@ describe "OracleEnhancedAdapter integer type detection based on column names" do
243
243
  expect(@employee2.is_manager.class).to eq(TrueClass)
244
244
  end
245
245
 
246
- it "should return Fixnum value from NUMBER(1) column if emulate booleans is not used" do
246
+ it "should return Integer value from NUMBER(1) column if emulate booleans is not used" do
247
247
  # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_booleans = false
248
248
  class ::Test2Employee < ActiveRecord::Base
249
249
  attribute :is_manager, :integer
250
250
  end
251
251
  create_employee2
252
- expect(@employee2.is_manager.class).to eq(Fixnum)
252
+ expect(@employee2.is_manager).to be_a(Integer)
253
253
  end
254
254
 
255
- it "should return Fixnum value from NUMBER(1) column if column specified in set_integer_columns" do
255
+ it "should return Integer value from NUMBER(1) column if column specified in set_integer_columns" do
256
256
  # ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_booleans = true
257
257
  # Test2Employee.set_integer_columns :is_manager
258
258
  class ::Test2Employee < ActiveRecord::Base
259
259
  attribute :is_manager, :integer
260
260
  end
261
261
  create_employee2
262
- expect(@employee2.is_manager.class).to eq(Fixnum)
262
+ expect(@employee2.is_manager).to be_a(Integer)
263
263
  end
264
264
 
265
265
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-oracle_enhanced-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raimonds Simanovskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-12 00:00:00.000000000 Z
11
+ date: 2016-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.5.1
136
+ rubygems_version: 2.5.2
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Oracle enhanced adapter for ActiveRecord