These columns were causing Rails 5.2 to throw a warning when ordering by them, as if they weren't valid column names: DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): :"budget/investments_count". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql(). This change also makes their names consistent with the rest of our tables and columns.
10 lines
353 B
Ruby
10 lines
353 B
Ruby
class RenameColumnsWithSlashCharacters < ActiveRecord::Migration[5.1]
|
|
def change
|
|
change_table :tags do |t|
|
|
t.rename :"budget/investments_count", :budget_investments_count
|
|
t.rename :"legislation/proposals_count", :legislation_proposals_count
|
|
t.rename :"legislation/processes_count", :legislation_processes_count
|
|
end
|
|
end
|
|
end
|