From a84997ebc7dab933f0358a775682f77712ff54df Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 30 Oct 2013 16:17:58 +1100 Subject: [PATCH] rails4 magic sauce --- Gemfile_rails4.lock | 1 + db/migrate/20121123054127_make_post_number_distinct.rb | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gemfile_rails4.lock b/Gemfile_rails4.lock index 128c950f0..b25cdf8d3 100644 --- a/Gemfile_rails4.lock +++ b/Gemfile_rails4.lock @@ -517,6 +517,7 @@ DEPENDENCIES qunit-rails rack-cors rack-mini-profiler! + rack-protection rails! rails-observers rails_multisite! diff --git a/db/migrate/20121123054127_make_post_number_distinct.rb b/db/migrate/20121123054127_make_post_number_distinct.rb index 4bca13b78..f6b4805a7 100644 --- a/db/migrate/20121123054127_make_post_number_distinct.rb +++ b/db/migrate/20121123054127_make_post_number_distinct.rb @@ -20,8 +20,11 @@ from ) as X where calc <> p.post_number and X.id = p.id') - remove_index :posts, :forum_thread_id_and_post_number - add_index :posts, [:topic_id, :post_number], unique: true + # automagically does this + unless rails4? + remove_index :posts, :forum_thread_id_and_post_number + add_index :posts, [:topic_id, :post_number], unique: true + end end def down