Forum: Ruby on Rails how to implement a status table

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.
Chris H. (Guest)
on 2009-04-15 00:03
(Received via mailing list)
I have a from that will have a status, "approved", "in
process",denied"... and such.

What is the best approach?
Status table,
One row with each column status type?
The form will have only one status so I will have to manage making
sure all columns that are not "true" will be false.

If I set it up so I populate the table with each row being a status
type then it will be easier to implement.
I could have a drop down to change status dynamically..

Any ideas?
Marnen L. (Guest)
on 2009-04-15 00:58
Chris H. wrote:
> I have a from that will have a status, "approved", "in
> process",denied"... and such.
>
> What is the best approach?

If a record can only have one status at a time, then it only needs one
status field.

Consider using aasm -- it's meant for exactly this purpose.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
removed_email_address@domain.invalid
Robert W. (Guest)
on 2009-04-15 01:05
Marnen Laibow-Koser wrote:
> Chris H. wrote:
>> I have a from that will have a status, "approved", "in
>> process",denied"... and such.
>>
>> What is the best approach?
>
> If a record can only have one status at a time, then it only needs one
> status field.
>
> Consider using aasm -- it's meant for exactly this purpose.

This is what Marnen suggested, which I concur:
http://github.com/rubyist/aasm/tree/master
Chris H. (Guest)
on 2009-04-15 01:07
(Received via mailing list)
OK, cool. thanks, looking now.

On Apr 14, 4:05 pm, Robert W. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.