Method: Jets::Commands::Call::AutoloadGuesser#underscored_name

Defined in:
lib/jets/commands/call/autoload_guesser.rb

#underscored_nameObject

Strips the action because we dont want it to guess the class name So:

admin-related-pages => admin_related_pages_controller


94
95
96
97
98
99
100
101
102
# File 'lib/jets/commands/call/autoload_guesser.rb', line 94

def underscored_name
  # strip action and concidentally the _controller_ string
  name = @provided_function_name.sub(process_type_pattern,'')
  # Ensure _controller or _job at the end except for simple functions
  unless process_type == "function"
    name = name.gsub('-','_') + "_#{process_type}"
  end
  name
end