Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ActiveRecord:Enum using string columns #2680

Merged

Conversation

tiii
Copy link
Contributor

@tiii tiii commented Jul 28, 2016

ActiveRecord::Enum supports storing values in string database columns. This behaviour is not yet described in the rails documentation, but recently a test case for it was added. (rails/rails@67c1719)

I did not add extra tests for it, since the active_record_enum Type has not been tested previously. I did however add ActiveRecord::Enum attributes (with and without string columns) to the test models, so the behaviour is at least tested implicitly.

@tiii tiii force-pushed the support-active-record-enum-string-columns branch from 2e30916 to 10bff49 Compare July 28, 2016 14:27
tiii added 2 commits July 28, 2016 17:14
This adds support for string-based enum columns.
There are no tests for the active_record_enum type. Now the integration
tests at least test them implicitly
@tiii tiii force-pushed the support-active-record-enum-string-columns branch from 10bff49 to 91bc566 Compare July 28, 2016 15:14
@mshibuya mshibuya merged commit 36d5085 into railsadminteam:master Aug 13, 2016
@mshibuya
Copy link
Member

Amazing, thanks!

@tiii tiii deleted the support-active-record-enum-string-columns branch August 13, 2016 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants