diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-19 14:11:06 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-19 14:11:06 +0100 |
commit | 2a130f0ed2a5ada0fda15ee71cd600a25810dcb4 (patch) | |
tree | 72a79dace910769847082af114c3ef3183f5bb9f /app/models/call_route.rb | |
parent | 3a0213af9ae9fab41dd854e94aa668ee2abc6414 (diff) | |
parent | bcbfb154a321953fd32696065e6af1bec85f9345 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/call_route.rb')
-rw-r--r-- | app/models/call_route.rb | 8 |
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 |