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

Running the server and specs fails for ActiveRecord based sample app #88

Closed
ashkan18 opened this issue Jan 16, 2019 · 3 comments
Closed
Labels

Comments

@ashkan18
Copy link
Contributor

Problem

Seeing this error when trying to rackup and also running specs for active record sample app:

Failure/Error: require 'slack-ruby-bot-server/rspec'

NoMethodError:
  undefined method `sort' for #<Class:0x00007fda978a48b8>
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/slack-ruby-bot-server-0.8.2/lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb:25:in `block in <class:TeamsEndpoint>'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/api/instance.rb:88:in `instance_eval'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/api/instance.rb:88:in `block in nest'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/api/instance.rb:88:in `each'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/api/instance.rb:88:in `nest'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/dsl/routing.rb:168:in `block in namespace'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/dsl/settings.rb:158:in `within_namespace'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/dsl/routing.rb:165:in `namespace'
# /Users/ashkinas/.rvm/gems/ruby-2.5.1/gems/grape-1.2.2/lib/grape/api.rb:119:in `block in add_setup'

Possible Cause?

Looking deeper it seems maybe with grape-1.2.2 adding SortHelper in

doesn't seem to add sort method to the endpoint.

@dblock
Copy link
Collaborator

dblock commented Jan 17, 2019

Interesting, sort was a class method. It's probably a regression from ruby-grape/grape#1803. You (or someone) should try writing a spec in Grape for this. We should be fixing it.

@dblock dblock added the bug? label Jan 17, 2019
@ashkan18
Copy link
Contributor Author

I think it's not Grape issue, or im getting the issue wrong :)

Looks like in this repo we are trying to add sort method to the endpoint in SortHelper here

and somehow adding SortHelper doesn't add sort method to the endpoint

@dblock
Copy link
Collaborator

dblock commented Jan 17, 2019

Fix in #89.

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

2 participants