m247/tickets — comment on commit 2fd4c883eb403d15e72b1ea142743e2a2a1cce7f
File: app/models/issue.rb line 5
By geoffgarside:

If you were going to store just an index of the item in the database then sure, though

```ruby
arr=%w(bronze silver gold platinum)
arr.map { |m| p [m, arr.index(m)+1] }
```

would probably be a bit cleaner. Using an integer to store the position within the array isn't an idea I'd favour for two reasons

1. harder to see from looking directly at the database what is going on
2. you need to make sure that you *never* change the order of options as you'll break the model
3. with a database index on a small set of strings SELECT queries should be fast enough