Module: RESTFramework::Mixins::ReadOnlyModelControllerMixin

Defined in:
lib/rest_framework/mixins/model_controller_mixin.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



77
78
79
80
81
82
83
84
85
86
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 77

def self.included(base)
  RESTFramework.deprecator.warn(<<~TXT).squish
    ReadOnlyModelControllerMixin is deprecated; use RESTFramework::Controller and set the `model`
    and `excluded_actions` class attributes instead.
  TXT

  base.include(RESTFramework::Controller)
  base.model = RESTFramework::Utils.get_model(base)
  base.excluded_actions = [ :create, :update, :destroy, :update_all, :destroy_all ].freeze
end