0

私はこのモデルを持っています

class Noticia
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Slug

  belongs_to :user

  field :titulo, :type => String
  field :conteudo, :type => String
  field :tags, :type => Array

  index :tags
  slug :titulo
end

この環境で

ActiveSupport::Inflector.inflections do |inflect|
  inflect.irregular 'inscricao', 'inscricoes'
  inflect.irregular 'noticia', 'noticias'
  inflect.irregular 'central', 'centrais'
end

「noticia」をローカルに作成すると、コレクション「noticia」に作成されます。しかし、heroku で「noticia」を作成すると、「noticias」というコレクションに表示されます。さらに、notciasコレクションには検索を実行するためのフィールドがありませんでしたtags。これは私のアプリにとって非常に重要ですnoticia

何か案は?

4

1 に答える 1

1

Inflect 呼び出しを Application.initialize の前に置くと聞いてよかったです! 問題を修正しました。

于 2012-05-10T13:38:54.983 に答える