Convert params to appropriate types on Model.new(params[:model]) in rails
Reported by travis (at appoxy) | October 9th, 2009 @ 10:57 AM
Currently sets them all as strings so if it gets saved, it saves as inputted string without the padding/offsets.
Eg:
class MyModel < SimpleRecord::Base
has_ints :x
end
Now say in view, you enter:
x: 123
now in controller, you do:
mm = MyModel.new(params[:my_model])
mm.save
123 will be saved directly without offset/padding. So when you retrieve the object, it will be some big negative number.
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A drop in replacement for ActiveRecord for Amazon SimpleDB.
Code hosted at http://github.com/appoxy/simple_record