[Ruby on Rails] Error: Range unspecified. Specify the :in, :within, :maximum, :minimum, or :is option.
In Ruby on Rails 3.2.2, I encountered an error when I wrote validation processing in a model and tried to run it.
■ Error Message
Range unspecified. Specify the :in, :within, :maximum, :minimum, or :is option.
■ Source Code (partial)
class Article < ActiveRecord::Base
validates :title,
length: { minimun: 0, maximun: 50 }
end
The cause was spelling mistakes in minimum and maximum.
◯ minimum ☓ minimun
◯ maximum ☓ maximun
That’s all from the Gemba.