mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
94b9306647
- Convert serializers/mixin_json_test.rb to rspec - Convert functional/thread_safety_test.rb to rspec - Convert functional/controller_test.rb to rspec - Move the dummy app from test to spec, delete test dir
28 lines
494 B
Ruby
28 lines
494 B
Ruby
class WidgetsController < ApplicationController
|
|
def paper_trail_enabled_for_controller
|
|
request.user_agent != "Disable User-Agent"
|
|
end
|
|
|
|
def create
|
|
@widget = Widget.create widget_params
|
|
head :ok
|
|
end
|
|
|
|
def update
|
|
@widget = Widget.find params[:id]
|
|
@widget.update_attributes widget_params
|
|
head :ok
|
|
end
|
|
|
|
def destroy
|
|
@widget = Widget.find params[:id]
|
|
@widget.destroy
|
|
head :ok
|
|
end
|
|
|
|
private
|
|
|
|
def widget_params
|
|
params[:widget].permit!
|
|
end
|
|
end
|