Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Simplify the Users table (!) #215

Closed
dgoerger opened this issue Jul 27, 2012 · 2 comments
Closed

Simplify the Users table (!) #215

dgoerger opened this issue Jul 27, 2012 · 2 comments

Comments

@dgoerger
Copy link
Contributor

Right now in the Users database table we have the following columns:

id, login, first_name, last_name, nickname, phone, email, affiliation, is_banned, is_admin, is_checkout_person, created_at, updated_at, adminmode, checkoutpersonmode, normalusermode, bannedmode, deleted_at, terms_of_service_accepted

IMO we should consolidate is_banned, is_admin, is_checkout_person into:

type => 'admin', 'checkout', 'normal', or 'banned'

This way we could avoid the ludicrous (although theoretically possible) situations of Banned-Admins and Admin-Checkoutpersons (there might be a validation against these??), and also make our codebase more extensible should we or anyone else decide in the future to add / remove user types. It would also make my implementation of #6 (CSV import) much simpler for assignment of user types..

[An initial thought on this: Map NIL, (blank), 'patron', and 'normal' to all mean the same thing, so for CSV import admins have some flexibility / freedom from jargon.]

Also,

adminmode, checkoutpersonmode, normalusermode, and bannedmode

should either be similarly consolidated or else completely moved to the session (ideal).

@ghost ghost assigned austinczarnecki Jun 27, 2013
@austinczarnecki
Copy link
Contributor

I'm redoing the rspec tests as I make these changes, but it's also going to break part of the seed script. Sorry @mnquintana, I'll leave that fix to you!

@austinczarnecki
Copy link
Contributor

Also fixed a bug with the page shown after importing users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants