Module: RESTFramework::BaseControllerMixin::ClassMethods

Extended by:
ClassMethodHelpers
Included in:
RESTFramework::BaseModelControllerMixin::ClassMethods
Defined in:
lib/rest_framework/controllers/base.rb

Instance Method Summary collapse

Methods included from ClassMethodHelpers

_restframework_attr_reader

Instance Method Details

#skip_actions(skip_undefined: true) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/rest_framework/controllers/base.rb', line 53

def skip_actions(skip_undefined: true)
  # first, skip explicitly skipped actions
  skip = _restframework_try_class_level_variable_get(:skip_actions, default: [])

  # 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