Permalink
Browse files

Merge pull request #11455 from antonio/fix_enable_extension_not_being…

…_defined

Define enable_extension method to prevent undefined method error
  • Loading branch information...
2 parents e0b1483 + fb9806e commit 52444f6a4b82764b45d6f08e466c89ea962b40e3 @rafaelfranca rafaelfranca committed Aug 2, 2013
@@ -291,6 +291,14 @@ def supports_extensions?
false
end
+ # This is meant to be implemented by the adapters that support extensions
+ def disable_extension(name)
+ end
+
+ # This is meant to be implemented by the adapters that support extensions
+ def enable_extension(name)
+ end
+
# A list of extensions, to be filled in by adapters that support them. At
# the moment only postgresql does.
def extensions
@@ -108,6 +108,18 @@ def test_tinyint_integer_typecasting
assert_equal 2, result.column_types['status'].type_cast(result.last['status'])
end
+ def test_supports_extensions
+ assert_not @conn.supports_extensions?, 'does not support extensions'
+ end
+
+ def test_respond_to_enable_extension
+ assert @conn.respond_to?(:enable_extension)
+ end
+
+ def test_respond_to_disable_extension
+ assert @conn.respond_to?(:disable_extension)
+ end
+
private
def insert(ctx, data, table='ex')
binds = data.map { |name, value|
@@ -354,6 +354,18 @@ def test_no_primary_key
assert_nil @conn.primary_key('failboat')
end
+ def test_supports_extensions
+ assert_not @conn.supports_extensions?, 'does not support extensions'
+ end
+
+ def test_respond_to_enable_extension
+ assert @conn.respond_to?(:enable_extension)
+ end
+
+ def test_respond_to_disable_extension
+ assert @conn.respond_to?(:disable_extension)
+ end
+
private
def assert_logged logs

0 comments on commit 52444f6

Please sign in to comment.