Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

backport type_cast_config_to_xxx adapter helpers from AR-4.0

  • Loading branch information...
commit 3d551a69f4cc588034343a137ca291639a0765ed 1 parent 8090b51
@kares kares authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/arjdbc/jdbc/adapter.rb
View
14 lib/arjdbc/jdbc/adapter.rb
@@ -19,7 +19,7 @@ class JdbcAdapter < AbstractAdapter
extend ShadowCoreMethods
include CompatibilityMethods if CompatibilityMethods.needed?(self)
include JdbcConnectionPoolCallbacks if JdbcConnectionPoolCallbacks.needed?
-
+
attr_reader :config
def initialize(connection, logger, config)
@@ -465,7 +465,19 @@ def self.insert?(sql)
def self.update?(sql)
! select?(sql) && ! insert?(sql)
end
+
+ unless defined? AbstractAdapter.type_cast_config_to_integer
+
+ def self.type_cast_config_to_integer(config)
+ config =~ /\A\d+\z/ ? config.to_i : config
+ end
+ def self.type_cast_config_to_boolean(config)
+ config == "false" ? false : config
+ end
+
+ end
+
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.