lib/arql/commands/table.rb in arql-0.2.7 vs lib/arql/commands/table.rb in arql-0.2.8
- old
+ new
@@ -23,10 +23,10 @@
t = []
t << ['PK', 'Name', 'SQL Type', 'Ruby Type', 'Limit', 'Precision', 'Scale', 'Default', 'Nullable', 'Comment']
t << nil
connection = ::ActiveRecord::Base.connection
connection.columns(table_name).each do |column|
- pk = if column.name == connection.primary_key(table_name)
+ pk = if [connection.primary_key(table_name)].flatten.include?(column.name)
'Y'
else
''
end
t << [pk, column.name, column.sql_type,