Displaying 1 result from an estimated 1 matches for "catch_resources_unavail".
2009 Dec 17
2
RFC: conflict_warnings plugin
...ed by another user before that first user confirms,
that first users'' attempt to confirm is blocked.
LockingResource example:
class LockingResourcesController < ApplicationController
before_filter :login_required, :acquire_lock
protected
def acquire_lock
catch_resources_unavailable current_user, :accessor
=> :acquire_lock_for_user,
:message => "Could not acquire lock"
end
end
If user cannot acquire a lock they are redirected back to the
referring page with the message
"Could not acquire lock" contained in flash[:warnings]...