Skip to content

Commit 7de6884

Browse files
committed
Include JSONAPI::ActAsResourceController by default
1 parent 7f600e0 commit 7de6884

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/jsonapi/utils.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module Utils
1010
include Response
1111

1212
def self.included(base)
13+
base.include ActsAsResourceController
14+
1315
if base.respond_to?(:before_action)
1416
base.before_action :jsonapi_request_handling
1517
end

spec/controllers/posts_controller_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require 'spec_helper'
2-
require 'pry'
32

43
describe PostsController, type: :controller do
54
include_context 'JSON API headers'

spec/support/controllers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'support/exceptions'
22

3-
class BaseController < JSONAPI::ResourceController
3+
class BaseController < ActionController::Base
44
include JSONAPI::Utils
55
protect_from_forgery with: :null_session
66
rescue_from ActiveRecord::RecordNotFound, with: :jsonapi_render_not_found

0 commit comments

Comments
 (0)