jdtornow / challah

User authorization and session management in Rails.
MIT License
18 stars 7 forks source link

Change User#active boolean to status enum #22

Closed jdtornow closed 8 years ago

jdtornow commented 8 years ago

Now that we're dropping pre 4.2 support, would be nice to use an enum in User instead of the older active flag.

Proposed states:

class User < ActiveRecord::Base

  include Challah::Userable

  enum status: %w( active inactive )

end

This would keep the active? attribute as before, but use the new data type. This would be a breaking database change so it will need to provide an upgrade path or keep backward compatibility.

jdtornow commented 8 years ago

Any objections to this @philtr?

philtr commented 8 years ago

Nope! I like this idea.

jdtornow commented 8 years ago

Excellent, I'll get this in the next release too.