diff --git a/app/models/debate.rb b/app/models/debate.rb index c30bc7b8d..f1e9a621e 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -138,7 +138,7 @@ class Debate < ActiveRecord::Base end def self.search(terms) - terms.present? ? where("unaccent(title) ILIKE unaccent(?) OR unaccent(description) ILIKE unaccent(?)", "%#{terms}%", "%#{terms}%") : none + terms.present? ? where("title ILIKE ? OR description ILIKE ?", "%#{terms}%", "%#{terms}%") : none end def conflictive? diff --git a/db/migrate/20150910185110_add_unaccent_extension.rb b/db/migrate/20150910185110_add_unaccent_extension.rb deleted file mode 100644 index d23af95d0..000000000 --- a/db/migrate/20150910185110_add_unaccent_extension.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddUnaccentExtension < ActiveRecord::Migration - def up - execute "CREATE EXTENSION IF NOT EXISTS unaccent" - end - - def down - execute "DROP EXTENSION unaccent" - end -end diff --git a/db/schema.rb b/db/schema.rb index 274192ccb..fde03fe30 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,11 +11,10 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150910185110) do +ActiveRecord::Schema.define(version: 20150910152734) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - enable_extension "unaccent" create_table "addresses", force: :cascade do |t| t.integer "user_id" @@ -259,7 +258,6 @@ ActiveRecord::Schema.define(version: 20150910185110) do t.datetime "letter_requested_at" t.datetime "confirmed_hide_at" t.string "letter_verification_code" - t.integer "letter_verification_tries", default: 0 end add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index bcddab7a4..edb5c2725 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -439,10 +439,10 @@ feature 'Debates' do debate1 = create(:debate, title: "Show me what you got") debate2 = create(:debate, title: "Get Schwifty") debate3 = create(:debate) - debate4 = create(:debate, description: "Schwíftÿ in here") + debate4 = create(:debate, description: "Schwifty in here") visit debates_path - fill_in "search", with: "Schwìfty" + fill_in "search", with: "Schwifty" click_button "Search" within("#debates") do