Populating Dropdown Values

I have a Order Status combo box with the following values All Orders,
Accepted, Declined, Gateway
Error, Offline, Refunded and Unknown.

What is the best approach to populate the dropdown values? Should I
store it in a table or define
it in as an array in a OrderStatus class? TIA

Bala P. wrote:

I have a Order Status combo box with the following values All Orders,
Accepted, Declined, Gateway
Error, Offline, Refunded and Unknown.

What is the best approach to populate the dropdown values? Should I
store it in a table or define
it in as an array in a OrderStatus class? TIA

do you plan to have new values in the future ? one day your Unknown
value could be split into 2,3 new values ? if , never… I’ll use an
array, if maybe… I’ll use a table…

kad

do you plan to have new values in the future ? one day your Unknown
value could be split into 2,3 new values ? if , never… I’ll use an
array, if maybe… I’ll use a table…

kad

It is very unlikely that the new values will be added. Performance wise
which one is better?

Performance wise, the array will win because there is no DB access
involved.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs