Created
October 7, 2011 21:24
-
-
Save chadmoone/1271379 to your computer and use it in GitHub Desktop.
lock issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
@text_frame = TextFrame.find(params[:id]) | |
# lock already exists, so this will return the existing lock | |
lock = Lock.new(current_user, @text_frame, "text_frame", params[:text_frame][:last_modified]) | |
if (!lock.save) | |
# handle error here, send bad status code and message | |
end | |
@text_frame.update_attributes(params[:text_frame]) | |
lock.destroy # now we've destroyed the lock that we didn't create and was supposed to be left | |
respond_with @text_frame | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment