summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/call_route.rb7
-rw-r--r--app/models/route_element.rb5
2 files changed, 12 insertions, 0 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb
index eba247c..de0f68a 100644
--- a/app/models/call_route.rb
+++ b/app/models/call_route.rb
@@ -2,4 +2,11 @@ class CallRoute < ActiveRecord::Base
attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position
has_many :route_elements, :dependent => :destroy
+
+ validates :name,
+ :presence => true
+
+ def to_s
+ name.to_s
+ end
end
diff --git a/app/models/route_element.rb b/app/models/route_element.rb
index e845f24..11bb54a 100644
--- a/app/models/route_element.rb
+++ b/app/models/route_element.rb
@@ -2,4 +2,9 @@ class RouteElement < ActiveRecord::Base
attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position
belongs_to :call_route
+
+ def to_s
+ "#{var_in} #{var_out}"
+ end
+
end