Forum: Ruby on Rails Can integers be nil in ActionWebService?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
82c59780911721f5cbe82d3111313519?d=identicon&s=25 Giant Cranes (giantcranes)
on 2007-02-07 12:26
Hi,

I am using the following struct in a webservice:

class ApiVehicle < ActionWebService::Struct
  member :id, :int
  member :manufacturer, :string
  member :manufacturer_model, :string
  member :year, :int
end

Is there a way to specify that the :year can be nil without changing the
type to :string?

Thanks,
GiantCranes
17fd339dc782f5adc7f57437e653d2cd?d=identicon&s=25 Tiago Macedo (Guest)
on 2007-02-07 13:47
(Received via mailing list)
There is a ticket in the rails trac with a patch to allow nillable
fields. Never tried it though:

http://dev.rubyonrails.org/ticket/5748

Tiago Macedo
82c59780911721f5cbe82d3111313519?d=identicon&s=25 Giant Cranes (giantcranes)
on 2007-02-07 13:52
Tiago Macedo wrote:
> There is a ticket in the rails trac with a patch to allow nillable
> fields. Never tried it though:
>
> http://dev.rubyonrails.org/ticket/5748
>
> Tiago Macedo

Thanks Tiago, I will try the patch.
This topic is locked and can not be replied to.