oracle-enhanced
oracle-enhanced copied to clipboard
ActiveRecord::ConnectionAdapters::OracleEnhanced::SchemaStatements#table_comment not working correctly in 6.x
Calling this method on a model with a table name in a different schema now only gives nil
. Whereas in version 5.2.x, it would correctly fetch the table's comment.
Steps to reproduce
- Add to Gemfile:
gem 'activerecord-oracle_enhanced-adapter', '6.1.4' gem 'rails', '6.1.5'
- Create a model (w/ migration) that lives in a non-standard DB schema.
then migrate# app/models/my_schema/my_model.rb module MySchema class MyModel < ApplicationRecord # which inherits from ActiveRecord::Base self.table_name = 'my_schema.my_model' # intentionally using singular name # other stuff... end end # db/migrate/01_create_my_schema_my_model.rb class CreateMySchemaMyModel < ActiveRecord::Migration[6.1] def change create_table 'my_schema.my_model', comment: "This model has a comment" do |t| # Some column definitions... end end end
- Open rails console, then call
ApplicationRecord.connection.table_comment(MySchema::MyModel.table_name)
- Exit rails consle, change Gemfile to use
re-bundle, then repeat step 3.gem 'activerecord-oracle_enhanced-adapter', '5.2.3' gem 'rails', '5.2.3'
Expected behavior
It should return the string "This model has a comment"
with all versions of the gem
Actual behavior
- It returns
nil
with the 6.x version of the gem - It correctly returns the string
"This model has a comment"
with the 5.2.x version of the gem
System configuration
Rails version: 6.1.5 / 5.2.3 for these examples
Oracle enhanced adapter version: 6.1.4 / 5.2.3 for these examples
Ruby version: 2.6.6 / 2.7.5
Oracle Database version: Oracle Database 19c Enterprise Edition - 19.14.0.0.0