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.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/parking_stall.rb b/app/models/parking_stall.rb
new file mode 100644
index 0000000..6af1fcd
--- /dev/null
+++ b/app/models/parking_stall.rb
@@ -0,0 +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