Created
June 25, 2011 02:54
-
-
Save alexhanh/1046068 to your computer and use it in GitHub Desktop.
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 set_event | |
| pack = Pack.includes(:replays).find(params[:id]) | |
| if !params[:event_id].nil? && !params[:event_id].empty? | |
| event = Event.find(params[:event_id]) | |
| pack.replays.update_all(:event_id => event.id) | |
| else | |
| pack.replays.update_all(:event_id => nil) | |
| end | |
| redirect_to pack, :notice => "Event has been updated succesfully for all pack's replays." | |
| end | |
| # AREL (0.4ms) UPDATE "replays" INNER JOIN "pack_games" ON "replays".id = "pack_games".replay_id SET "event_id" = 1 WHERE (("pack_games".pack_id = 25)) | |
| # PGError: ERROR: syntax error at or near "INNER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment