Ruby Fuzzily relation "trigrams" does not exist -
i'm trying use ruby gem fuzzily in rails application, getting error
relation "trigrams" not exist
i followed instructions https://github.com/mezis/fuzzily
here's code
trigram.rb
class trigram < activerecord::base include url::model include fuzzily::model end
url.rb
class url < activerecord::base fuzzily_searchable :short_url end
add_trigram_mode.rb
class addtrigramsmodel < activerecord::migration extend url::migration extend fuzzily::migration trigrams_owner_id_column_type = :uuid end
i did rake db:migrate. when execute in rails console, get:
url.find_by_fuzzy_short_url('sojdgl') url load (1.4ms) select "urls".* "urls" order "urls"."id" asc limit 100 pg::undefinedtable: error: relation "trigrams" not exist line 5: a.attrelid = '"trigrams"'::regclass ^ : select a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod pg_attribute left join pg_attrdef d on a.attrelid = d.adrelid , a.attnum = d.adnum a.attrelid = '"trigrams"'::regclass , a.attnum > 0 , not a.attisdropped order a.attnum activerecord::statementinvalid: pg::undefinedtable: error: relation "trigrams" not exist line 5: a.attrelid = '"trigrams"'::regclass
i named migration file incorrectly. works when changed 20150830110623_add_trigrams_model.rb
Comments
Post a Comment