Skip to content

Instantly share code, notes, and snippets.

@xander-miller
Created February 25, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xander-miller/86bee7e4c7a2896357c5 to your computer and use it in GitHub Desktop.
Save xander-miller/86bee7e4c7a2896357c5 to your computer and use it in GitHub Desktop.
Code to get a Hash of attribute names and associated database types
Post.attribute_names.map {|n| [n.to_sym,Post.type_for_attribute(n).type]}.to_h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment