File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,11 +46,14 @@ def self.get_skipped_builtin_actions(controller_class, singular)
4646 RESTFramework ::BUILTIN_ACTIONS . keys - ( singular ? [ :index ] : [ ] )
4747 ) + RESTFramework ::BUILTIN_MEMBER_ACTIONS . keys
4848
49+ # Skip all builtin actions for controllers without a model, since the builtin actions assume a
50+ # model is present.
4951 return candidates unless controller_class . model
5052
53+ # Skip actions if there is no method defined or if the action is explicitly excluded.
5154 exclude = controller_class . excluded_actions &.to_set || Set . new
52- candidates . reject do |action |
53- controller_class . method_defined? ( action ) && ! exclude . include? ( action )
55+ candidates . select do |action |
56+ ! controller_class . method_defined? ( action ) || exclude . include? ( action )
5457 end
5558 end
5659
You can’t perform that action at this time.
0 commit comments