Suppose you have a Post model:
Post.column_names
# or
Post.columns.map { |column| column.name }
It will return an array with column names of the table ‘posts’.
Suppose you have a Post model:
Post.column_names
# or
Post.columns.map { |column| column.name }
It will return an array with column names of the table ‘posts’.