P
P
Piranis2014-04-03 02:38:51
Ruby on Rails
Piranis, 2014-04-03 02:38:51

Rails models, how to implement the ability to select one of the three order states?

There is a table :orders with fields name and phone. How to make an order have three states (deleted, completed, rejected, canceled by the client)?
Through a secondary key with a state field and a primary key, or is there some more elegant way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eydemidov, 2014-04-03
@Piranis

The statuses table with a one-to-many relationship to the orders table is quite an elegant way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question