Skip to content

Commit

Permalink
Building model con validaciones
Browse files Browse the repository at this point in the history
  • Loading branch information
Libranner committed Sep 30, 2013
1 parent 99a0e51 commit 97c4dab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/building.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Building < ActiveRecord::Base
attr_accessible :abbreviation, :floors, :name, :rooms
validates :abbreviation, length: {is: 2}
validates :rooms, numericality: {greater_than: 0}
validates :floors, numericality: {greater_than: 0}
#a shot at the night

end

0 comments on commit 97c4dab

Please sign in to comment.