Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to create an index in db.seed running rspec fails #977

Open
aleguro opened this issue Feb 4, 2021 · 3 comments
Open

Trying to create an index in db.seed running rspec fails #977

aleguro opened this issue Feb 4, 2021 · 3 comments
Labels

Comments

@aleguro
Copy link

aleguro commented Feb 4, 2021

Under db/seeds.rb

Model.__elasticsearch__.create_index! force: true

$ bundle exec rspec --backtrace

Backtrace


backtrace

Model

class Model
  include Mongoid::Document
  include Mongoid::Attributes::Dynamic
  include Elasticsearch::Model

  def as_indexed_json(_options = {})
    as_json(only: %w[id name product_id product_variant_id])
  end
end
@indirect
Copy link
Contributor

I opened a PR with a fix for this. If you're impatient, you can update your Gemfile entry for elasticsearch-model to use the fix before they merge the fix and release a new version:

gem "elasticsearch-model", github: "indirect/elasticsearch-rails"

@indirect
Copy link
Contributor

(At least, I hope it's a fix! It seems like the same keyword arguments issue. If it's not, apologies.)

@aleguro
Copy link
Author

aleguro commented Apr 26, 2021

Thanks for your help @indirect !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants