Class: ActiveForce::ModelGenerator::String
- Inherits:
-
Object
- Object
- ActiveForce::ModelGenerator::String
- Defined in:
- lib/generators/active_force/model/model_generator.rb
Instance Method Summary collapse
Instance Method Details
#underscore ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/generators/active_force/model/model_generator.rb', line 52 def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end |