From cb1e09a7ef061cd3c1ca7cf5793d09b2aacb1536 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Fri, 4 Apr 2014 18:35:40 -0400 Subject: Cookie size 20 minutes --- Gemfile | 2 +- Gemfile.lock | 2 -- app/helpers/sessions_helper.rb | 4 ++-- app/models/match.rb | 3 +++ app/views/matches/show.html.erb | 19 +++++++++++++++++++ 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index fadfd18..a34b0a6 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'httparty' gem 'simple_captcha2', require: 'simple_captcha' -gem 'rmagick' +#gem 'rmagick' group :development, :test do # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index a2d2578..51e29e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,6 @@ GEM rdoc (4.1.1) json (~> 1.4) ref (1.0.5) - rmagick (2.13.2) sass (3.2.18) sass-rails (4.0.2) railties (>= 4.0.0, < 5.0) @@ -134,7 +133,6 @@ DEPENDENCIES jbuilder (~> 1.2) jquery-rails rails (= 4.0.2) - rmagick sass-rails (~> 4.0.0) sdoc simple_captcha2 diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb index 89e5ef3..60ddfa6 100644 --- a/app/helpers/sessions_helper.rb +++ b/app/helpers/sessions_helper.rb @@ -5,8 +5,8 @@ module SessionsHelper @session.save # FIXME: error handling @token = Session.hash_token(raw_token) - cookies.permanent[:remember_token] = raw_token - + #cookies.permanent[:remember_token] = raw_token + cookies.permanent[:remember_token] = { value: remember_token, expires: 20.minutes.from_now.utc } #set the current user to be the given user @current_user = user end diff --git a/app/models/match.rb b/app/models/match.rb index 35deb20..c596ced 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -5,4 +5,7 @@ class Match < ActiveRecord::Base belongs_to :winner, class_name: "Team" + def setup() + + end end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 53c3b38..4973dc3 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -12,7 +12,24 @@ Name: <%= @match.name %>

+ + <% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> <%= form_for([@tournament, @match], method: "put") do |f| %>