saberma-activerecord-oracle_enhanced-adapter-nvarchar2 1.2.1 → 1.2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -276,13 +276,13 @@ module ActiveRecord
276
276
  name =~ /(^|_)id$/i
277
277
  end
278
278
 
279
- # RSI: set to true if CHAR(1), VARCHAR2(1) columns or VARCHAR2 columns with FLAG or YN at the end of their name
279
+ # RSI: set to true if CHAR(1), NVARCHAR2(1) columns or NVARCHAR2 columns with FLAG or YN at the end of their name
280
280
  # should be emulated as booleans
281
281
  @@emulate_booleans_from_strings = false
282
282
  cattr_accessor :emulate_booleans_from_strings
283
283
  def self.is_boolean_column?(name, field_type, table_name = nil)
284
- return true if ["CHAR(1)","VARCHAR2(1)"].include?(field_type)
285
- field_type =~ /^VARCHAR2/ && (name =~ /_flag$/i || name =~ /_yn$/i)
284
+ return true if ["CHAR(1)","NVARCHAR2(1)"].include?(field_type)
285
+ field_type =~ /^NVARCHAR2/ && (name =~ /_flag$/i || name =~ /_yn$/i)
286
286
  end
287
287
  def self.boolean_to_string(bool)
288
288
  bool ? "Y" : "N"
@@ -303,7 +303,7 @@ module ActiveRecord
303
303
  def native_database_types #:nodoc:
304
304
  {
305
305
  :primary_key => "NUMBER(38) NOT NULL PRIMARY KEY",
306
- :string => { :name => "VARCHAR2", :limit => 255 },
306
+ :string => { :name => "NVARCHAR2", :limit => 255 },
307
307
  :text => { :name => "CLOB" },
308
308
  :integer => { :name => "NUMBER", :limit => 38 },
309
309
  :float => { :name => "NUMBER" },
@@ -315,9 +315,9 @@ module ActiveRecord
315
315
  :time => { :name => "DATE" },
316
316
  :date => { :name => "DATE" },
317
317
  :binary => { :name => "BLOB" },
318
- # RSI: if emulate_booleans_from_strings then store booleans in VARCHAR2
318
+ # RSI: if emulate_booleans_from_strings then store booleans in NVARCHAR2
319
319
  :boolean => emulate_booleans_from_strings ?
320
- { :name => "VARCHAR2", :limit => 1 } : { :name => "NUMBER", :limit => 1 }
320
+ { :name => "NVARCHAR2", :limit => 1 } : { :name => "NUMBER", :limit => 1 }
321
321
  }
322
322
  end
323
323
 
@@ -651,7 +651,7 @@ module ActiveRecord
651
651
  select column_name as name, data_type as sql_type, data_default, nullable,
652
652
  decode(data_type, 'NUMBER', data_precision,
653
653
  'FLOAT', data_precision,
654
- 'VARCHAR2', data_length,
654
+ 'NVARCHAR2', data_length,
655
655
  'CHAR', data_length,
656
656
  null) as limit,
657
657
  decode(data_type, 'NUMBER', data_scale, null) as scale
@@ -291,7 +291,7 @@ module ActiveRecord
291
291
  else
292
292
  BigDecimal.new(d.stringValue)
293
293
  end
294
- when :VARCHAR2, :CHAR, :LONG
294
+ when :NVARCHAR2, :CHAR, :LONG
295
295
  rset.getString(i)
296
296
  when :DATE
297
297
  if dt = rset.getDATE(i)
@@ -107,7 +107,7 @@ module ActiveRecord #:nodoc:
107
107
  "VALIDATE" => true,
108
108
  "VALUES" => true,
109
109
  "VARCHAR" => true,
110
- "VARCHAR2" => true,
110
+ "NVARCHAR2" => true,
111
111
  "VIEW" => true,
112
112
  "WHENEVER" => true,
113
113
  "WHERE" => true,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{activerecord-oracle_enhanced-adapter-nvarchar2}
5
- s.version = "1.2.1"
5
+ s.version = "1.2.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Raimonds Simanovskis"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saberma-activerecord-oracle_enhanced-adapter-nvarchar2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raimonds Simanovskis