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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Giant Cranes wrote:> 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 > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 MacedoThanks Tiago, I will try the patch. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---