interagent / pliny

An opinionated toolkit for writing excellent APIs in Ruby.
MIT License
802 stars 73 forks source link

Fix rake schema #216

Closed hayduke19us closed 9 years ago

hayduke19us commented 9 years ago

I noticed that the rake schema task was throwing a NoMethodError. In lib/tasks/schema.rb the Pliny::Commands::Generator::Schema.new(nil).rebuild.

The error was occurring because the private method in the Base class #normalize_name was trying to #underscore nil.

I added a ternary in the initialization for the name attribute.

Basically Don't normalize if name is nil!

brandur commented 9 years ago

Thanks @hayduke19us! Great tests as well.