diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-01 13:46:30 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-05-05 12:11:57 -0700 |
commit | 7d02bcd2e0165a90a9f2c1edb34b064ff76afd69 (patch) | |
tree | 3b74cbbf74fca3b36effa5ea4b33d8bd29e22f73 /app/models/redirect_route.rb | |
parent | f4a2dfb46f168d3fd7309aca8631cf680456fa82 (diff) | |
download | gitlab-ce-7d02bcd2e0165a90a9f2c1edb34b064ff76afd69.tar.gz |
Redirect from redirect routes to canonical routes
Diffstat (limited to 'app/models/redirect_route.rb')
-rw-r--r-- | app/models/redirect_route.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/redirect_route.rb b/app/models/redirect_route.rb new file mode 100644 index 00000000000..e36ca988701 --- /dev/null +++ b/app/models/redirect_route.rb @@ -0,0 +1,10 @@ +class RedirectRoute < ActiveRecord::Base + belongs_to :source, polymorphic: true + + validates :source, presence: true + + validates :path, + length: { within: 1..255 }, + presence: true, + uniqueness: { case_sensitive: false } +end |