summaryrefslogtreecommitdiff
path: root/app/models/switchboard.rb
diff options
context:
space:
mode:
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