Created
April 23, 2012 23:18
-
-
Save brenes/2474454 to your computer and use it in GitHub Desktop.
Create an enum for 'parent_id' ancestry column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| field :parent_id, :enum do | |
| enum do | |
| (ProcessType.select("id, name")||[]).map{|c|[c.name, c.id]} || [] #this is just an example though | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment