Skip to content

Instantly share code, notes, and snippets.

@brenes
Created April 23, 2012 23:18
Show Gist options
  • Select an option

  • Save brenes/2474454 to your computer and use it in GitHub Desktop.

Select an option

Save brenes/2474454 to your computer and use it in GitHub Desktop.
Create an enum for 'parent_id' ancestry column
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