Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cast a couple strings to integers

While I don't plan to enable it by default, with these changes,
giftsmas works with the automatic parameterization support.
  • Loading branch information...
commit 00a87c3a8e0e158654dc5c5ac2bee24a7802a0e7 1 parent 027b1d7
@jeremyevans authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  giftsmas.rb
  2. +1 −1  models/person.rb
View
2  giftsmas.rb
@@ -138,7 +138,7 @@ class Giftsmas < Sinatra::Base
end
post '/choose_event' do
- e = Event[:user_id=>@user.id, :id=>params[:event_id]]
+ e = Event[:user_id=>@user.id, :id=>params[:event_id].to_i]
session[:event_id] = e.id
redirect('/', 303)
end
View
2  models/person.rb
@@ -10,7 +10,7 @@ class Person < Sequel::Model
many_to_many :gifts_received, :class=>:Gift, :join_table=>:gift_receivers, :right_key=>:gift_id, :order=>:inserted_at
def self.for_user_by_id(user, id)
- first(:user_id=>user.id, :id=>id)
+ first(:user_id=>user.id, :id=>id.to_i)
end
def self.for_user_by_name(user, name)
Please sign in to comment.
Something went wrong with that request. Please try again.