summaryrefslogtreecommitdiff
path: root/app/models/parking_stall.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/parking_stall.rb')
-rw-r--r--app/models/parking_stall.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/parking_stall.rb b/app/models/parking_stall.rb
index 52223a8..6af1fcd 100644
--- a/app/models/parking_stall.rb
+++ b/app/models/parking_stall.rb
@@ -1,3 +1,17 @@
class ParkingStall < ActiveRecord::Base
attr_accessible :name, :lot, :parking_stallable_id, :parking_stallable_type, :comment
+
+ belongs_to :parking_stallable, :polymorphic => true, :touch => true
+
+ validates :name,
+ :presence => true,
+ :uniqueness => true
+
+ validates :lot,
+ :presence => true
+
+ def to_s
+ name.to_s
+ end
+
end