Skip to content

Instantly share code, notes, and snippets.

@syntruth
Created July 9, 2010 15:57
Show Gist options
  • Save syntruth/469637 to your computer and use it in GitHub Desktop.
Save syntruth/469637 to your computer and use it in GitHub Desktop.
module ActiveRecord
class Base
def Base.options(field)
return find(:all).inject([]) do |arr, record|
arr.push([record.send(field), record.id])
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment