Method: Mobility::Util#foreign_key
- Defined in:
- lib/mobility/util.rb
#foreign_key(str) ⇒ String
Creates a foreign key name from a class name
83 84 85 86 87 |
# File 'lib/mobility/util.rb', line 83 def foreign_key(str) call_or_yield str do "#{underscore(demodulize(str))}_id" end end |