DEV: Upgrade Discourse to Rails 6 (#8083)

* Adjustments to pass specs on Rails 6.0.0
* Use classic autoloader instead of Zeitwerk
* Update Rails 6.0.0 deprecated methods
* Rails 6.0.0 not allowing column with integer name
* Drop freedom_patches/rails6.rb
* Default value for trigger_transactional_callbacks? is true
* Bump rspec-rails version to 4.0.0.beta2
This commit is contained in:
Krzysztof Kotlarek
2019-09-12 10:41:50 +10:00
committed by Sam
parent eeb84806bc
commit 32b8a2ccff
17 changed files with 80 additions and 185 deletions

View File

@@ -4,8 +4,8 @@ class AddTopicAllowedGroups < ActiveRecord::Migration[4.2]
def change
create_table :topic_allowed_groups, force: true do |t|
# oops
t.integer :group_id, :integer, null: false
t.integer :topic_id, :integer, null: false
t.integer :group_id, null: false
t.integer :topic_id, null: false
end
add_index :topic_allowed_groups, [:group_id, :topic_id], unique: true

View File

@@ -3,6 +3,6 @@
class FixTopicAllowedGroups < ActiveRecord::Migration[4.2]
def change
# big oops
remove_column :topic_allowed_groups, :integer
remove_column :topic_allowed_groups, :integer if column_exists?(:topic_allowed_groups, :integer)
end
end