Module: RESTFramework::BaseControllerMixin::ClassMethods

Defined in:
lib/rest_framework/controller_mixins/base.rb

Instance Method Summary collapse

Instance Method Details

#get_skip_actions(skip_undefined: true) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rest_framework/controller_mixins/base.rb', line 15

def get_skip_actions(skip_undefined: true)
  # first, skip explicitly skipped actions
  skip = self.skip_actions || []

  # now add methods which don't exist, since we don't want to route those
  if skip_undefined
    [:index, :new, :create, :show, :edit, :update, :destroy].each do |a|
      skip << a unless self.method_defined?(a)
    end
  end

  return skip
end