module JsonapiForRails::Controller::BeforeActions::ContentNegotiation

Public Class Methods

included(receiver) click to toggle source
# File lib/jsonapi_for_rails/controller/before_actions/content_negotiation.rb, line 6
def self.included receiver
        #$stderr.puts "JsonapiForRails::Controller::RecordFromRequest included into #{receiver}"
        receiver.send :include, InstanceMethods
        run_macros receiver
end
run_macros(receiver) click to toggle source
# File lib/jsonapi_for_rails/controller/before_actions/content_negotiation.rb, line 12
def self.run_macros receiver
        receiver.instance_exec do 
                before_action :jsonapi_content_negotiation, only: [
                        :create, 
                        :update,
                        
                        :relationship_update,
                        :relationship_add,
                        :relationship_remove
                ]

                private :jsonapi_content_negotiation
        end
end