-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Milestone
Description
Hello,
there is no automatically parsing on assigning numerical values yet.
Following works in ActiveRecord:
class Company < ActiveRecord::Base
attr_accessible :sort_key
end
c = Company.new
c.attributes = {sort_key: '13'}
c.sort_key #=> 13
c.sort_key.class #=> FixnumWhich doesn't yet work in `Elastictastic':
class Company
include Elastictastic::Document
field :sort_key, type: :integer
end
c = Company.new
c.attributes = {sort_key: '13'}
c.sort_key #=> '13'
c.sort_key.class #=> StringThat makes it really unhandy to assign numerical values from request params (for even integer values are submitted as strings).
Would be great if it would work!
Thanx!
Kostia
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels