config.active_record.schema_format = :sqlOn Wednesday, October 24, 2012 at 4:15 AM, ida...@gmail.com wrote:
I'm using pg_search to get PostgreSQL's full-text search working in my Rails project. I'm using the "unaccent" extension, and I have written the following in my seeds.rb file to load the extension in my development environment:
ActiveRecord::Base.connection.execute("CREATE EXTENSION unaccent;")
ActiveRecord::Base.connection.execute("ALTER TEXT SEARCH DICTIONARY unaccent (RULES='unaccent');")
ActiveRecord::Base.connection.execute("CREATE TEXT SEARCH CONFIGURATION es ( COPY = spanish );")
ActiveRecord::Base.connection.execute("ALTER TEXT SEARCH CONFIGURATION es
ALTER MAPPING FOR hword, hword_part, word
WITH unaccent, spanish_stem;")This works perfectly in develpment.
Now I want to run some functional search tests, but I get an error saying that the extension is not configured:
ActiveRecord::StatementInvalid: PG::Error: ERROR: function unaccent(text) does not existSo I assume I have to do the same that I did for development, but for the test environment, isn't it?
Or maybe there is another approach?
--