summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-19 09:08:36 +0100
committerspag <spag@golwen.net>2013-01-19 09:08:36 +0100
commitc1cdcc3927a8632157017cf15801d2a508eed2ad (patch)
tree6821733745e6e4b45a852a3d51a9f1ec7155753e /app
parentbb7992ac94e763c80fc7f4b5d850a19d88f5bf3b (diff)
move methods added
Diffstat (limited to 'app')
-rw-r--r--app/models/call_route.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb
index 5d90901..1fe61e9 100644
--- a/app/models/call_route.rb
+++ b/app/models/call_route.rb
@@ -18,4 +18,12 @@ class CallRoute < ActiveRecord::Base
def to_s
name.to_s
end
+
+ def move_up?
+ return self.position.to_i > CallRoute.where(:routing_table => self.routing_table ).order(:position).first.position.to_i
+ end
+
+ def move_down?
+ return self.position.to_i < CallRoute.where(:routing_table => self.routing_table ).order(:position).last.position.to_i
+ end
end