Created
July 10, 2016 14:40
-
-
Save kirkelifson/da85df4b9e9878208dac1ca744be9e71 to your computer and use it in GitHub Desktop.
Selects all column names containing phone and not containing type
This file contains 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
phones = Model.attribute_names.select { |c| c.include? 'phone' }.reject { |c| c.include? 'type' }.map(&:to_sym) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment