Created
February 22, 2018 02:00
-
-
Save awesome/f1e7d2d3dfb01759b90dab4656e89579 to your computer and use it in GitHub Desktop.
holy shit! the capitalized underscore _ID is a column name! gonna use: `.underscore.camelcase` for an easy win; see: http://api.rubyonrails.org/classes/String.html#method-i-camelize
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
| irb(main):016:0> "cool_id".camelcase | |
| => "CoolId" | |
| irb(main):017:0> "cool_id".camelcase(:lower) | |
| => "coolId" | |
| irb(main):018:0> "ServerID".underscore | |
| => "server_id" | |
| irb(main):019:0> "ServerID".underscore.camelcase(:lower) | |
| => "serverId" | |
| irb(main):020:0> "ServerID".camelcase(:lower) | |
| => "serverID" | |
| irb(main):021:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment