11module ActiveRecord
2- class Base # reopen
2+ # ActiveRecord::Base extensions.
3+ Base . class_eval do
34 class << self
4- # Allow adapters to provide their own reset_column_information methods
5- #
6- # NOTE: This only affects the current thread's connection.
7- def reset_column_information_with_arjdbc_base_ext
8- # Invoke the adapter-specific reset_column_information method
5+ # Allow adapters to provide their own {#reset_column_information} method.
6+ # @note This only affects the current thread's connection.
7+ def reset_column_information_with_arjdbc
8+ # invoke the adapter-specific reset_column_information method
99 connection . reset_column_information if connection . respond_to? ( :reset_column_information )
10- reset_column_information_without_arjdbc_base_ext
10+ reset_column_information_without_arjdbc
11+ end
12+ unless method_defined? ( "reset_column_information_without_arjdbc" )
13+ alias_method_chain :reset_column_information , :arjdbc
14+ end
15+ end
16+ end
17+
18+ # Represents exceptions that have propagated up through the JDBC API.
19+ class JDBCError < ActiveRecordError
20+ # The vendor code or error number that came from the database
21+ attr_accessor :errno
22+ # The full Java SQLException object that was raised.
23+ attr_accessor :sql_exception
24+ end
25+
26+ module ConnectionAdapters # :nodoc:
27+ # Allows properly re-defining methods that may already be alias_method_chain'd.
28+ module ShadowCoreMethods
29+ def alias_chained_method ( name , feature , target )
30+ # NOTE: aliasing for things such as columns (with feature query_cache)
31+ # seems to only be used for 2.3 since 3.0 methods are not aliased ...
32+ if method_defined? ( method = "#{ name } _without_#{ feature } " )
33+ alias_method method , target
34+ else
35+ alias_method name , target if name . to_s != target . to_s
36+ end
1137 end
12- alias_method_chain :reset_column_information , :arjdbc_base_ext unless instance_methods . include? ( "reset_column_information_without_arjdbc_base_ext" )
1338 end
1439 end
15- end
40+ end
0 commit comments