Skip to content

Commit

Permalink
Fix deprecated render nothing: true
Browse files Browse the repository at this point in the history
DEPRECATION WARNING: `:nothing` option is deprecated and will be removed
in Rails 5.1. Use `head` method to respond with empty response body.
  • Loading branch information
eagletmt committed Jan 17, 2017
1 parent 43ce067 commit 34dd20c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -25,7 +25,7 @@ def login_required_api
end

def nothing
render(nothing: true)
head 200
end

def logged_in?
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/application_controller_spec.rb
Expand Up @@ -8,7 +8,7 @@
before_action :login_required

def index
render nothing: true
head 200
end
end

Expand Down Expand Up @@ -45,7 +45,7 @@ def index
before_action :current_member

def index
render nothing: true
head 200
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/favicon_controller_spec.rb
Expand Up @@ -13,7 +13,7 @@
it "should send favicon" do
expect(Feed).to receive(:find_by).with(feedlink: @feed.link) { @feed }
expect(controller).to receive(:send_data).with(anything, image_header) {
@controller.render nothing: true
@controller.head 200
}
get :get, feed: @feed.link
end
Expand Down

0 comments on commit 34dd20c

Please sign in to comment.