summaryrefslogtreecommitdiff
path: root/app/models/switchboard.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 13:15:35 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-07 13:15:35 +0100
commitdb9dbf03d88cfbd68ce99a242730b9e870339539 (patch)
tree72947eddcb03f8a6ae6efd79a035bd9e761b4963 /app/models/switchboard.rb
parent3e19646f46c772e10ed3d7a45e8c974ab23f625b (diff)
Added Switchboard scaffold.
Diffstat (limited to 'app/models/switchboard.rb')
-rw-r--r--app/models/switchboard.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/switchboard.rb b/app/models/switchboard.rb
new file mode 100644
index 0000000..cb0c70f
--- /dev/null
+++ b/app/models/switchboard.rb
@@ -0,0 +1,14 @@
+class Switchboard < ActiveRecord::Base
+ # https://github.com/rails/strong_parameters
+ include ActiveModel::ForbiddenAttributesProtection
+
+ validates :name,
+ :presence => true,
+ :uniqueness => {:scope => :user_id}
+
+ belongs_to :user, :touch => true
+
+ def to_s
+ self.name.to_s
+ end
+end