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
Add Rails 5 compatible version #10
Add Rails 5 compatible version #10
Conversation
- Use kwargs in HTTP request methods in rspec See: rails/rails#18323
- params should be of type Hash on access
@@ -24,7 +24,7 @@ def destroy | |||
job.destroy | |||
respond_with job | |||
else | |||
render nothing: true, status: 404 | |||
head 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, if you want something more verbose: head :not_found
http://guides.rubyonrails.org/layouts_and_rendering.html#the-status-option
@@ -19,15 +19,15 @@ Gem::Specification.new do |s| | |||
|
|||
s.add_dependency "kaminari" | |||
s.add_dependency "api-pagination" | |||
s.add_dependency "rails", "~> 4.0" | |||
s.add_dependency "rails", ">= 4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.add_dependency "rails", "~> 5.0"
?
Curious, wouldn't this mean Rails 4 apps would still be able to use this version, regardless of the following alterations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Rails 4 apps would still be compatible.
See commit 22bb65f
i18n (~> 0.7) | ||
minitest (~> 5.1) | ||
tzinfo (~> 1.1) | ||
api-pagination (4.7.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On asyncapi-client, I have the following on my changelog:
include Rails::Paginate for api-pagination 4.5 or higher
FYI in case you're using this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have it documented on commit 3a1ab7e
Thanks for the heads up! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI
7e81f0f
to
ed67b92
Compare
- Make gem Rails 5 compatible
0c8a4fc
to
754508f
Compare
- This allows the post method to support both Rails 4 and Rails 5 versions - On Rails 5 applications use `asyncapi_post(url, params: params)` instead of `asyncapi_post(url, params)`
754508f
to
03797af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Changes Proposed in this Pull Request:
Upgrade Rails version to ~> 5.1
Use kwargs in HTTP request methods in rspec
Reference: Use kwargs in ActionController::TestCase and ActionDispatch::Integration HTTP methods rails/rails#18323
Manually include the Rails::Pagination module in
Server::V1::JobsController
Reference: davidcelis/api-pagination@45e6068#diff-04c6e90faac2675aa89e2176d2eec7d8