Comments (1)
Yep, if you need to add new values and leave all old values it will work without any problems, so if you have
status ('pending', 'active')
and want to have
status ('pending', 'active', 'canceled')
just make a migration like
But if some of old values are going to be removed you should take care of objects with such values manually. For example if you need to rename some value you should do like this:
execute('update tasks set status="active" where status="actice"')
change_column :tasks, :status, :enum, :limit => [:pending, :active]
from enum_column.
Related Issues (12)
- Plugin generates error with Rails 3.2 HOT 4
- Does not seem to work with `validates :gender, :inclusion => { :in => %w{male female} }` HOT 7
- Error on Rails 3.2.6
- Support stand-alone ActiveRecord HOT 1
- "Unrails" the gem so that it works outside of rails as well
- Enum_select includes blank option for null.
- rake db:schema:dump not generating enums in Rails 3.1.0 HOT 10
- This is incompatible with rails 4.2 HOT 4
- Gemspec Version regressed HOT 1
- Schema dump issues HOT 2
- enum_select error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enum_column.