Commit 2a977bfc by ryu39 Committed by Cuong Tran

Fix error when table_name is frozen (#517)

parent 63cc88c1
......@@ -212,8 +212,8 @@ module AnnotateModels
return indexes if indexes.any? || !klass.table_name_prefix
# Try to search the table without prefix
table_name.to_s.slice!(klass.table_name_prefix)
klass.connection.indexes(table_name)
table_name_without_prefix = table_name.to_s.sub(klass.table_name_prefix, '')
klass.connection.indexes(table_name_without_prefix)
end
# Use the column information in an ActiveRecord class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment