Dave
Dave

Reputation: 1175

How best to define a record as free or premium?

I'm creating an app where a user can own many venues and each can have a free or premium listing. Whats the best way to define a venue as free or premium?

Currently I have a string field which stores 'free' or 'premium' (with free being the default) for each venue record, selected from a dropdown menu in the edit page. The dropdown gets the free and premium inputs from roles set up in the model (I'm using the cancan gem to assign different attributes).

Is this a robust enough way to define free and premium?

Thanks for any input its much appreciated!

Upvotes: 2

Views: 79

Answers (1)

sarvavijJana
sarvavijJana

Reputation: 1212

Consider to use boolean datatype for this purpose

name column :premium & set default value equal to false

Upvotes: 2

Related Questions