diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-17 09:52:00 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-17 09:52:00 +0100 |
commit | c09073174bb51561030a48f95f283b63b0ddae34 (patch) | |
tree | fb82681cf83c4a9cbe6fe310f2ea8942c8311d4f /app/models/route_element.rb | |
parent | 416a9c563ed52b2b4f5350b8a069313f5843489c (diff) | |
parent | 85d8dc12c3963f78ea1db4089c6ff2fa6ec205e9 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/models/route_element.rb')
-rw-r--r-- | app/models/route_element.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 11bb54a..d3302ea 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -1,8 +1,23 @@ class RouteElement < ActiveRecord::Base + ELEMENT_ACTIONS = ['match', 'not_match', 'set_route_var', 'set_header'] + attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position belongs_to :call_route + acts_as_list :scope => :call_route + + validates :var_in, + :presence => true + + validates :pattern, + :presence => true + + validates :action, + :presence => true, + :inclusion => { :in => ELEMENT_ACTIONS } + + def to_s "#{var_in} #{var_out}" end |