Commit 5328293a87c39c63bea941461009537ae8870109
1 parent
b445b482
Exists in
master
and in
1 other branch
whitespace cleanup
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
app/models/app.rb
@@ -25,7 +25,7 @@ class App | @@ -25,7 +25,7 @@ class App | ||
25 | 25 | ||
26 | before_validation :generate_api_key, :on => :create | 26 | before_validation :generate_api_key, :on => :create |
27 | before_save :normalize_github_url | 27 | before_save :normalize_github_url |
28 | - | 28 | + |
29 | validates_presence_of :name, :api_key | 29 | validates_presence_of :name, :api_key |
30 | validates_uniqueness_of :name, :allow_blank => true | 30 | validates_uniqueness_of :name, :allow_blank => true |
31 | validates_uniqueness_of :api_key, :allow_blank => true | 31 | validates_uniqueness_of :api_key, :allow_blank => true |
@@ -60,15 +60,15 @@ class App | @@ -60,15 +60,15 @@ class App | ||
60 | !(self[:notify_on_deploys] == false) | 60 | !(self[:notify_on_deploys] == false) |
61 | end | 61 | end |
62 | alias :notify_on_deploys? :notify_on_deploys | 62 | alias :notify_on_deploys? :notify_on_deploys |
63 | - | 63 | + |
64 | def github_url? | 64 | def github_url? |
65 | self.github_url.present? | 65 | self.github_url.present? |
66 | end | 66 | end |
67 | - | 67 | + |
68 | def github_url_to_file(file) | 68 | def github_url_to_file(file) |
69 | "#{self.github_url}/blob/master#{file}" | 69 | "#{self.github_url}/blob/master#{file}" |
70 | end | 70 | end |
71 | - | 71 | + |
72 | protected | 72 | protected |
73 | 73 | ||
74 | def generate_api_key | 74 | def generate_api_key |
@@ -83,12 +83,12 @@ class App | @@ -83,12 +83,12 @@ class App | ||
83 | end if issue_tracker.errors | 83 | end if issue_tracker.errors |
84 | end | 84 | end |
85 | end | 85 | end |
86 | - | 86 | + |
87 | def normalize_github_url | 87 | def normalize_github_url |
88 | return if self.github_url.blank? | 88 | return if self.github_url.blank? |
89 | self.github_url.gsub!(%r{^http://|git@}, 'https://') | 89 | self.github_url.gsub!(%r{^http://|git@}, 'https://') |
90 | self.github_url.gsub!(/github\.com:/, 'github.com/') | 90 | self.github_url.gsub!(/github\.com:/, 'github.com/') |
91 | self.github_url.gsub!(/\.git$/, '') | 91 | self.github_url.gsub!(/\.git$/, '') |
92 | end | 92 | end |
93 | - | 93 | + |
94 | end | 94 | end |