Commit 3c38f9c2 authored by francisco javier casas barrientos's avatar francisco javier casas barrientos
Browse files

Added CarType name validation.

parent 3c5185cc
No related merge requests found
Showing with 2 additions and 0 deletions
+2 -0
......@@ -3,5 +3,7 @@ class CarType < ActiveRecord::Base
validates :brand, :presence => true
validates :name, :presence => true
validates_uniqueness_of :name, :scope => :brand
has_many :cars
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment