Sha256: e9f5a84591f6d1944ce6587b55c114f0638ccd79c44b9acaf137764eff2760ca
Contents?: true
Size: 880 Bytes
Versions: 57
Compression:
Stored size: 880 Bytes
Contents
module Pageflow class EditLocksController < Pageflow::ApplicationController before_action :authenticate_user! respond_to :json def create entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) entry.snapshot(:creator => current_user) respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry)) end def update entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) head :no_content end def destroy entry = Entry.find(params[:entry_id]) entry.edit_lock.release(current_user) head :no_content end protected def edit_lock_params params.permit(:edit_lock => [:force, :id]).fetch(:edit_lock, {}) end end end
Version data entries
57 entries across 57 versions & 1 rubygems