Commit f5576dbcf350ec1746d80457a7ee54d9905d7079
Exists in
master
and in
1 other branch
Merge pull request #178 from shingara/rails-3-2
Upgrade to Rails 3.2
Showing
20 changed files
with
159 additions
and
156 deletions
Show diff stats
.travis.yml
1 | rvm: | 1 | rvm: |
2 | + - 1.9.3 | ||
2 | - 1.9.2 | 3 | - 1.9.2 |
3 | - 1.8.7 | 4 | - 1.8.7 |
4 | 5 | ||
5 | -# Only build master branch | ||
6 | -branches: | ||
7 | - only: | ||
8 | - - master | ||
9 | 6 | ||
10 | # To stop Travis from running tests for a new commit, | 7 | # To stop Travis from running tests for a new commit, |
11 | # add the following to your commit message: [ci skip] | 8 | # add the following to your commit message: [ci skip] |
Gemfile
1 | source 'http://rubygems.org' | 1 | source 'http://rubygems.org' |
2 | 2 | ||
3 | -gem 'rails', '3.0.10' | 3 | +RAILS_VERSION = '~> 3.2.0' |
4 | +gem 'activesupport',RAILS_VERSION, :require => 'active_support' | ||
5 | +gem 'actionpack', RAILS_VERSION, :require => 'action_pack' | ||
6 | +gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer' | ||
7 | +gem 'railties', RAILS_VERSION, :require => 'rails' | ||
8 | + | ||
4 | gem 'nokogiri' | 9 | gem 'nokogiri' |
5 | gem 'mongoid', '~> 2.2.2' | 10 | gem 'mongoid', '~> 2.2.2' |
6 | 11 | ||
@@ -20,7 +25,7 @@ gem 'hoptoad_notifier', "~> 2.4" | @@ -20,7 +25,7 @@ gem 'hoptoad_notifier', "~> 2.4" | ||
20 | gem 'actionmailer_inline_css', "~> 1.3.0" | 25 | gem 'actionmailer_inline_css', "~> 1.3.0" |
21 | gem 'kaminari' | 26 | gem 'kaminari' |
22 | gem 'rack-ssl-enforcer' | 27 | gem 'rack-ssl-enforcer' |
23 | -gem 'fabrication' # Both for tests, and loading demo data | 28 | +gem 'fabrication', "~> 1.3.0" # Both for tests, and loading demo data |
24 | 29 | ||
25 | platform :ruby do | 30 | platform :ruby do |
26 | gem 'mongo', '= 1.3.1' | 31 | gem 'mongo', '= 1.3.1' |
@@ -35,7 +40,7 @@ group :development, :test do | @@ -35,7 +40,7 @@ group :development, :test do | ||
35 | gem 'webmock', :require => false | 40 | gem 'webmock', :require => false |
36 | unless ENV['TRAVIS'] | 41 | unless ENV['TRAVIS'] |
37 | gem 'ruby-debug', :platform => :mri_18 | 42 | gem 'ruby-debug', :platform => :mri_18 |
38 | - gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug' | 43 | + # gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug' |
39 | end | 44 | end |
40 | # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" | 45 | # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" |
41 | end | 46 | end |
Gemfile.lock
@@ -2,50 +2,50 @@ GEM | @@ -2,50 +2,50 @@ GEM | ||
2 | remote: http://rubygems.org/ | 2 | remote: http://rubygems.org/ |
3 | specs: | 3 | specs: |
4 | SystemTimer (1.2.3) | 4 | SystemTimer (1.2.3) |
5 | - abstract (1.0.0) | ||
6 | - actionmailer (3.0.10) | ||
7 | - actionpack (= 3.0.10) | ||
8 | - mail (~> 2.2.19) | 5 | + actionmailer (3.2.3) |
6 | + actionpack (= 3.2.3) | ||
7 | + mail (~> 2.4.4) | ||
9 | actionmailer_inline_css (1.3.1) | 8 | actionmailer_inline_css (1.3.1) |
10 | actionmailer (>= 3.0.0) | 9 | actionmailer (>= 3.0.0) |
11 | nokogiri (>= 1.4.4) | 10 | nokogiri (>= 1.4.4) |
12 | premailer (>= 1.7.1) | 11 | premailer (>= 1.7.1) |
13 | - actionpack (3.0.10) | ||
14 | - activemodel (= 3.0.10) | ||
15 | - activesupport (= 3.0.10) | ||
16 | - builder (~> 2.1.2) | ||
17 | - erubis (~> 2.6.6) | ||
18 | - i18n (~> 0.5.0) | ||
19 | - rack (~> 1.2.1) | ||
20 | - rack-mount (~> 0.6.14) | ||
21 | - rack-test (~> 0.5.7) | ||
22 | - tzinfo (~> 0.3.23) | ||
23 | - activemodel (3.0.10) | ||
24 | - activesupport (= 3.0.10) | ||
25 | - builder (~> 2.1.2) | ||
26 | - i18n (~> 0.5.0) | ||
27 | - activerecord (3.0.10) | ||
28 | - activemodel (= 3.0.10) | ||
29 | - activesupport (= 3.0.10) | ||
30 | - arel (~> 2.0.10) | ||
31 | - tzinfo (~> 0.3.23) | ||
32 | - activeresource (3.0.10) | ||
33 | - activemodel (= 3.0.10) | ||
34 | - activesupport (= 3.0.10) | ||
35 | - activesupport (3.0.10) | ||
36 | - addressable (2.2.6) | ||
37 | - archive-tar-minitar (0.5.2) | ||
38 | - arel (2.0.10) | 12 | + actionpack (3.2.3) |
13 | + activemodel (= 3.2.3) | ||
14 | + activesupport (= 3.2.3) | ||
15 | + builder (~> 3.0.0) | ||
16 | + erubis (~> 2.7.0) | ||
17 | + journey (~> 1.0.1) | ||
18 | + rack (~> 1.4.0) | ||
19 | + rack-cache (~> 1.2) | ||
20 | + rack-test (~> 0.6.1) | ||
21 | + sprockets (~> 2.1.2) | ||
22 | + activemodel (3.2.3) | ||
23 | + activesupport (= 3.2.3) | ||
24 | + builder (~> 3.0.0) | ||
25 | + activerecord (3.2.3) | ||
26 | + activemodel (= 3.2.3) | ||
27 | + activesupport (= 3.2.3) | ||
28 | + arel (~> 3.0.2) | ||
29 | + tzinfo (~> 0.3.29) | ||
30 | + activeresource (3.2.3) | ||
31 | + activemodel (= 3.2.3) | ||
32 | + activesupport (= 3.2.3) | ||
33 | + activesupport (3.2.3) | ||
34 | + i18n (~> 0.6) | ||
35 | + multi_json (~> 1.0) | ||
36 | + addressable (2.2.8) | ||
37 | + arel (3.0.2) | ||
39 | bcrypt-ruby (3.0.1) | 38 | bcrypt-ruby (3.0.1) |
40 | bson (1.3.1) | 39 | bson (1.3.1) |
41 | bson_ext (1.3.1) | 40 | bson_ext (1.3.1) |
42 | - builder (2.1.2) | ||
43 | - columnize (0.3.4) | 41 | + builder (3.0.0) |
42 | + columnize (0.3.6) | ||
44 | crack (0.3.1) | 43 | crack (0.3.1) |
45 | - css_parser (1.2.5) | 44 | + css_parser (1.2.6) |
46 | addressable | 45 | addressable |
46 | + rdoc | ||
47 | database_cleaner (0.6.7) | 47 | database_cleaner (0.6.7) |
48 | - devise (1.4.7) | 48 | + devise (1.4.9) |
49 | bcrypt-ruby (~> 3.0) | 49 | bcrypt-ruby (~> 3.0) |
50 | orm_adapter (~> 0.0.3) | 50 | orm_adapter (~> 0.0.3) |
51 | warden (~> 1.0.3) | 51 | warden (~> 1.0.3) |
@@ -53,48 +53,49 @@ GEM | @@ -53,48 +53,49 @@ GEM | ||
53 | email_spec (1.2.1) | 53 | email_spec (1.2.1) |
54 | mail (~> 2.2) | 54 | mail (~> 2.2) |
55 | rspec (~> 2.0) | 55 | rspec (~> 2.0) |
56 | - erubis (2.6.6) | ||
57 | - abstract (>= 1.0.0) | ||
58 | - fabrication (1.2.0) | ||
59 | - faraday (0.7.4) | ||
60 | - addressable (~> 2.2.6) | ||
61 | - multipart-post (~> 1.1.0) | ||
62 | - rack (>= 1.1.0, < 2) | 56 | + erubis (2.7.0) |
57 | + fabrication (1.3.2) | ||
58 | + faraday (0.7.6) | ||
59 | + addressable (~> 2.2) | ||
60 | + multipart-post (~> 1.1) | ||
61 | + rack (~> 1.1) | ||
63 | faraday_middleware (0.7.0) | 62 | faraday_middleware (0.7.0) |
64 | faraday (~> 0.7.3) | 63 | faraday (~> 0.7.3) |
65 | - haml (3.1.3) | 64 | + haml (3.1.5) |
66 | happymapper (0.4.0) | 65 | happymapper (0.4.0) |
67 | libxml-ruby (~> 2.0) | 66 | libxml-ruby (~> 2.0) |
68 | has_scope (0.5.1) | 67 | has_scope (0.5.1) |
69 | hashie (1.0.0) | 68 | hashie (1.0.0) |
69 | + hike (1.2.1) | ||
70 | hoptoad_notifier (2.4.11) | 70 | hoptoad_notifier (2.4.11) |
71 | activesupport | 71 | activesupport |
72 | builder | 72 | builder |
73 | - htmlentities (4.3.0) | ||
74 | - i18n (0.5.0) | ||
75 | - inherited_resources (1.3.0) | 73 | + htmlentities (4.3.1) |
74 | + i18n (0.6.0) | ||
75 | + inherited_resources (1.3.1) | ||
76 | has_scope (~> 0.5.0) | 76 | has_scope (~> 0.5.0) |
77 | - responders (~> 0.6.0) | ||
78 | - kaminari (0.12.4) | ||
79 | - rails (>= 3.0.0) | ||
80 | - kgio (2.6.0) | ||
81 | - libxml-ruby (2.2.2) | 77 | + responders (~> 0.6) |
78 | + journey (1.0.3) | ||
79 | + json (1.7.1) | ||
80 | + kaminari (0.13.0) | ||
81 | + actionpack (>= 3.0.0) | ||
82 | + activesupport (>= 3.0.0) | ||
83 | + railties (>= 3.0.0) | ||
84 | + kgio (2.7.4) | ||
85 | + libxml-ruby (2.3.2) | ||
82 | lighthouse-api (2.0) | 86 | lighthouse-api (2.0) |
83 | activeresource (>= 3.0.0) | 87 | activeresource (>= 3.0.0) |
84 | activesupport (>= 3.0.0) | 88 | activesupport (>= 3.0.0) |
85 | linecache (0.46) | 89 | linecache (0.46) |
86 | rbx-require-relative (> 0.0.4) | 90 | rbx-require-relative (> 0.0.4) |
87 | - linecache19 (0.5.12) | ||
88 | - ruby_core_source (>= 0.1.4) | ||
89 | - mail (2.2.19) | ||
90 | - activesupport (>= 2.3.6) | 91 | + mail (2.4.4) |
91 | i18n (>= 0.4.0) | 92 | i18n (>= 0.4.0) |
92 | mime-types (~> 1.16) | 93 | mime-types (~> 1.16) |
93 | treetop (~> 1.4.8) | 94 | treetop (~> 1.4.8) |
94 | - mime-types (1.16) | 95 | + mime-types (1.18) |
95 | mongo (1.3.1) | 96 | mongo (1.3.1) |
96 | bson (>= 1.3.1) | 97 | bson (>= 1.3.1) |
97 | - mongoid (2.2.4) | 98 | + mongoid (2.2.5) |
98 | activemodel (~> 3.0) | 99 | activemodel (~> 3.0) |
99 | mongo (~> 1.3) | 100 | mongo (~> 1.3) |
100 | tzinfo (~> 0.3.22) | 101 | tzinfo (~> 0.3.22) |
@@ -104,18 +105,18 @@ GEM | @@ -104,18 +105,18 @@ GEM | ||
104 | rails (>= 3.0.0) | 105 | rails (>= 3.0.0) |
105 | railties (>= 3.0.0) | 106 | railties (>= 3.0.0) |
106 | multi_json (1.0.4) | 107 | multi_json (1.0.4) |
107 | - multipart-post (1.1.4) | ||
108 | - nokogiri (1.5.0) | 108 | + multipart-post (1.1.5) |
109 | + nokogiri (1.5.2) | ||
109 | octokit (0.6.4) | 110 | octokit (0.6.4) |
110 | addressable (~> 2.2.6) | 111 | addressable (~> 2.2.6) |
111 | faraday (~> 0.7.3) | 112 | faraday (~> 0.7.3) |
112 | faraday_middleware (~> 0.7.0.rc1) | 113 | faraday_middleware (~> 0.7.0.rc1) |
113 | hashie (~> 1.0.0) | 114 | hashie (~> 1.0.0) |
114 | multi_json (~> 1.0.2) | 115 | multi_json (~> 1.0.2) |
115 | - orm_adapter (0.0.5) | 116 | + orm_adapter (0.0.7) |
116 | oruen_redmine_client (0.0.1) | 117 | oruen_redmine_client (0.0.1) |
117 | activeresource (>= 2.3.0) | 118 | activeresource (>= 2.3.0) |
118 | - pivotal-tracker (0.4.1) | 119 | + pivotal-tracker (0.5.4) |
119 | builder | 120 | builder |
120 | builder | 121 | builder |
121 | happymapper (>= 0.3.2) | 122 | happymapper (>= 0.3.2) |
@@ -124,86 +125,82 @@ GEM | @@ -124,86 +125,82 @@ GEM | ||
124 | nokogiri (~> 1.4) | 125 | nokogiri (~> 1.4) |
125 | rest-client (~> 1.6.0) | 126 | rest-client (~> 1.6.0) |
126 | rest-client (~> 1.6.0) | 127 | rest-client (~> 1.6.0) |
127 | - polyglot (0.3.2) | 128 | + polyglot (0.3.3) |
128 | premailer (1.7.3) | 129 | premailer (1.7.3) |
129 | css_parser (>= 1.1.9) | 130 | css_parser (>= 1.1.9) |
130 | htmlentities (>= 4.0.0) | 131 | htmlentities (>= 4.0.0) |
131 | - rack (1.2.4) | ||
132 | - rack-mount (0.6.14) | ||
133 | - rack (>= 1.0.0) | 132 | + rack (1.4.1) |
133 | + rack-cache (1.2) | ||
134 | + rack (>= 0.4) | ||
135 | + rack-ssl (1.3.2) | ||
136 | + rack | ||
134 | rack-ssl-enforcer (0.2.4) | 137 | rack-ssl-enforcer (0.2.4) |
135 | - rack-test (0.5.7) | 138 | + rack-test (0.6.1) |
136 | rack (>= 1.0) | 139 | rack (>= 1.0) |
137 | - rails (3.0.10) | ||
138 | - actionmailer (= 3.0.10) | ||
139 | - actionpack (= 3.0.10) | ||
140 | - activerecord (= 3.0.10) | ||
141 | - activeresource (= 3.0.10) | ||
142 | - activesupport (= 3.0.10) | 140 | + rails (3.2.3) |
141 | + actionmailer (= 3.2.3) | ||
142 | + actionpack (= 3.2.3) | ||
143 | + activerecord (= 3.2.3) | ||
144 | + activeresource (= 3.2.3) | ||
145 | + activesupport (= 3.2.3) | ||
143 | bundler (~> 1.0) | 146 | bundler (~> 1.0) |
144 | - railties (= 3.0.10) | ||
145 | - railties (3.0.10) | ||
146 | - actionpack (= 3.0.10) | ||
147 | - activesupport (= 3.0.10) | 147 | + railties (= 3.2.3) |
148 | + railties (3.2.3) | ||
149 | + actionpack (= 3.2.3) | ||
150 | + activesupport (= 3.2.3) | ||
151 | + rack-ssl (~> 1.3.2) | ||
148 | rake (>= 0.8.7) | 152 | rake (>= 0.8.7) |
149 | rdoc (~> 3.4) | 153 | rdoc (~> 3.4) |
150 | - thor (~> 0.14.4) | 154 | + thor (~> 0.14.6) |
151 | raindrops (0.8.0) | 155 | raindrops (0.8.0) |
152 | - rake (0.9.2) | ||
153 | - rbx-require-relative (0.0.5) | ||
154 | - rdoc (3.9.4) | ||
155 | - responders (0.6.4) | 156 | + rake (0.9.2.2) |
157 | + rbx-require-relative (0.0.9) | ||
158 | + rdoc (3.12) | ||
159 | + json (~> 1.4) | ||
160 | + responders (0.9.1) | ||
161 | + railties (~> 3.1) | ||
156 | rest-client (1.6.7) | 162 | rest-client (1.6.7) |
157 | mime-types (>= 1.16) | 163 | mime-types (>= 1.16) |
158 | ri_cal (0.8.8) | 164 | ri_cal (0.8.8) |
159 | - rspec (2.6.0) | ||
160 | - rspec-core (~> 2.6.0) | ||
161 | - rspec-expectations (~> 2.6.0) | ||
162 | - rspec-mocks (~> 2.6.0) | ||
163 | - rspec-core (2.6.4) | ||
164 | - rspec-expectations (2.6.0) | ||
165 | - diff-lcs (~> 1.1.2) | ||
166 | - rspec-mocks (2.6.0) | ||
167 | - rspec-rails (2.6.1) | ||
168 | - actionpack (~> 3.0) | ||
169 | - activesupport (~> 3.0) | ||
170 | - railties (~> 3.0) | ||
171 | - rspec (~> 2.6.0) | 165 | + rspec (2.10.0) |
166 | + rspec-core (~> 2.10.0) | ||
167 | + rspec-expectations (~> 2.10.0) | ||
168 | + rspec-mocks (~> 2.10.0) | ||
169 | + rspec-core (2.10.0) | ||
170 | + rspec-expectations (2.10.0) | ||
171 | + diff-lcs (~> 1.1.3) | ||
172 | + rspec-mocks (2.10.1) | ||
173 | + rspec-rails (2.10.1) | ||
174 | + actionpack (>= 3.0) | ||
175 | + activesupport (>= 3.0) | ||
176 | + railties (>= 3.0) | ||
177 | + rspec (~> 2.10.0) | ||
172 | ruby-debug (0.10.4) | 178 | ruby-debug (0.10.4) |
173 | columnize (>= 0.1) | 179 | columnize (>= 0.1) |
174 | ruby-debug-base (~> 0.10.4.0) | 180 | ruby-debug-base (~> 0.10.4.0) |
175 | ruby-debug-base (0.10.4) | 181 | ruby-debug-base (0.10.4) |
176 | linecache (>= 0.3) | 182 | linecache (>= 0.3) |
177 | - ruby-debug-base19 (0.11.25) | ||
178 | - columnize (>= 0.3.1) | ||
179 | - linecache19 (>= 0.5.11) | ||
180 | - ruby_core_source (>= 0.1.4) | ||
181 | - ruby-debug19 (0.11.6) | ||
182 | - columnize (>= 0.3.1) | ||
183 | - linecache19 (>= 0.5.11) | ||
184 | - ruby-debug-base19 (>= 0.11.19) | ||
185 | - ruby-fogbugz (0.0.4) | 183 | + ruby-fogbugz (0.1.1) |
186 | crack | 184 | crack |
187 | - typhoeus | ||
188 | - ruby_core_source (0.1.5) | ||
189 | - archive-tar-minitar (>= 0.5.2) | 185 | + sprockets (2.1.3) |
186 | + hike (~> 1.2) | ||
187 | + rack (~> 1.0) | ||
188 | + tilt (~> 1.1, != 1.3.0) | ||
190 | thor (0.14.6) | 189 | thor (0.14.6) |
190 | + tilt (1.3.3) | ||
191 | treetop (1.4.10) | 191 | treetop (1.4.10) |
192 | polyglot | 192 | polyglot |
193 | polyglot (>= 0.3.1) | 193 | polyglot (>= 0.3.1) |
194 | - typhoeus (0.2.4) | ||
195 | - mime-types | ||
196 | - mime-types | ||
197 | - tzinfo (0.3.30) | ||
198 | - unicorn (4.1.1) | ||
199 | - kgio (~> 2.4) | 194 | + tzinfo (0.3.33) |
195 | + unicorn (4.3.1) | ||
196 | + kgio (~> 2.6) | ||
200 | rack | 197 | rack |
201 | - raindrops (~> 0.6) | 198 | + raindrops (~> 0.7) |
202 | useragent (0.3.2) | 199 | useragent (0.3.2) |
203 | - warden (1.0.5) | 200 | + warden (1.0.6) |
204 | rack (>= 1.0) | 201 | rack (>= 1.0) |
205 | - webmock (1.7.6) | ||
206 | - addressable (~> 2.2, > 2.2.5) | 202 | + webmock (1.8.6) |
203 | + addressable (>= 2.2.7) | ||
207 | crack (>= 0.1.7) | 204 | crack (>= 0.1.7) |
208 | 205 | ||
209 | PLATFORMS | 206 | PLATFORMS |
@@ -211,13 +208,16 @@ PLATFORMS | @@ -211,13 +208,16 @@ PLATFORMS | ||
211 | 208 | ||
212 | DEPENDENCIES | 209 | DEPENDENCIES |
213 | SystemTimer | 210 | SystemTimer |
211 | + actionmailer (~> 3.2.0) | ||
214 | actionmailer_inline_css (~> 1.3.0) | 212 | actionmailer_inline_css (~> 1.3.0) |
213 | + actionpack (~> 3.2.0) | ||
214 | + activesupport (~> 3.2.0) | ||
215 | bson (= 1.3.1) | 215 | bson (= 1.3.1) |
216 | bson_ext (= 1.3.1) | 216 | bson_ext (= 1.3.1) |
217 | database_cleaner (~> 0.6.0) | 217 | database_cleaner (~> 0.6.0) |
218 | devise (~> 1.4.0) | 218 | devise (~> 1.4.0) |
219 | email_spec | 219 | email_spec |
220 | - fabrication | 220 | + fabrication (~> 1.3.0) |
221 | haml | 221 | haml |
222 | hoptoad_notifier (~> 2.4) | 222 | hoptoad_notifier (~> 2.4) |
223 | htmlentities (~> 4.3.0) | 223 | htmlentities (~> 4.3.0) |
@@ -232,12 +232,11 @@ DEPENDENCIES | @@ -232,12 +232,11 @@ DEPENDENCIES | ||
232 | oruen_redmine_client | 232 | oruen_redmine_client |
233 | pivotal-tracker | 233 | pivotal-tracker |
234 | rack-ssl-enforcer | 234 | rack-ssl-enforcer |
235 | - rails (= 3.0.10) | 235 | + railties (~> 3.2.0) |
236 | ri_cal | 236 | ri_cal |
237 | rspec (~> 2.6) | 237 | rspec (~> 2.6) |
238 | rspec-rails (~> 2.6) | 238 | rspec-rails (~> 2.6) |
239 | ruby-debug | 239 | ruby-debug |
240 | - ruby-debug19 | ||
241 | ruby-fogbugz | 240 | ruby-fogbugz |
242 | unicorn | 241 | unicorn |
243 | useragent (~> 0.3.1) | 242 | useragent (~> 0.3.1) |
app/models/app.rb
@@ -14,12 +14,13 @@ class App | @@ -14,12 +14,13 @@ class App | ||
14 | # Some legacy apps may have string as key instead of BSON::ObjectID | 14 | # Some legacy apps may have string as key instead of BSON::ObjectID |
15 | identity :type => String | 15 | identity :type => String |
16 | 16 | ||
17 | - # There seems to be a Mongoid bug making it impossible to use String identity with references_many feature: | ||
18 | - # https://github.com/mongoid/mongoid/issues/703 | ||
19 | - # Using 32 character string as a workaround. | ||
20 | - before_create do |r| | ||
21 | - r.id = ActiveSupport::SecureRandom.hex | ||
22 | - end | 17 | + # Bug fix |
18 | + # # There seems to be a Mongoid bug making it impossible to use String identity with references_many feature: | ||
19 | + # # https://github.com/mongoid/mongoid/issues/703 | ||
20 | + # # Using 32 character string as a workaround. | ||
21 | + # before_create do |r| | ||
22 | + # r.id = ActiveSupport::SecureRandom.hex | ||
23 | + # end | ||
23 | 24 | ||
24 | embeds_many :watchers | 25 | embeds_many :watchers |
25 | embeds_many :deploys | 26 | embeds_many :deploys |
@@ -154,7 +155,7 @@ class App | @@ -154,7 +155,7 @@ class App | ||
154 | end | 155 | end |
155 | 156 | ||
156 | def generate_api_key | 157 | def generate_api_key |
157 | - self.api_key ||= ActiveSupport::SecureRandom.hex | 158 | + self.api_key ||= SecureRandom.hex |
158 | end | 159 | end |
159 | 160 | ||
160 | def check_issue_tracker | 161 | def check_issue_tracker |
app/models/issue_trackers/lighthouse_tracker.rb
@@ -23,7 +23,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker | @@ -23,7 +23,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker | ||
23 | Lighthouse.token = api_token | 23 | Lighthouse.token = api_token |
24 | # updating lighthouse account | 24 | # updating lighthouse account |
25 | Lighthouse::Ticket.site | 25 | Lighthouse::Ticket.site |
26 | - | 26 | + Lighthouse::Ticket.format = :xml |
27 | ticket = Lighthouse::Ticket.new(:project_id => project_id) | 27 | ticket = Lighthouse::Ticket.new(:project_id => project_id) |
28 | ticket.title = issue_title problem | 28 | ticket.title = issue_title problem |
29 | 29 |
app/models/issue_trackers/redmine_tracker.rb
@@ -31,6 +31,7 @@ class IssueTrackers::RedmineTracker < IssueTracker | @@ -31,6 +31,7 @@ class IssueTrackers::RedmineTracker < IssueTracker | ||
31 | RedmineClient::Base.configure do | 31 | RedmineClient::Base.configure do |
32 | self.token = token | 32 | self.token = token |
33 | self.site = acc | 33 | self.site = acc |
34 | + self.format = :xml | ||
34 | end | 35 | end |
35 | issue = RedmineClient::Issue.new(:project_id => project_id) | 36 | issue = RedmineClient::Issue.new(:project_id => project_id) |
36 | issue.subject = issue_title problem | 37 | issue.subject = issue_title problem |
app/views/layouts/application.html.haml
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | = javascript_include_tag :defaults | 10 | = javascript_include_tag :defaults |
11 | = stylesheet_link_tag 'reset', 'application', 'jquery.alerts' | 11 | = stylesheet_link_tag 'reset', 'application', 'jquery.alerts' |
12 | :css | 12 | :css |
13 | - #{render :partial => "issue_trackers/icons.css"} | 13 | + #{render :partial => "issue_trackers/icons", :formats => :css} |
14 | 14 | ||
15 | = yield :head | 15 | = yield :head |
16 | %body{:id => controller.controller_name, :class => controller.action_name} | 16 | %body{:id => controller.controller_name, :class => controller.action_name} |
config/application.rb
@@ -20,7 +20,7 @@ module Errbit | @@ -20,7 +20,7 @@ module Errbit | ||
20 | # -- all .rb files in that directory are automatically loaded. | 20 | # -- all .rb files in that directory are automatically loaded. |
21 | 21 | ||
22 | # Custom directories with classes and modules you want to be autoloadable. | 22 | # Custom directories with classes and modules you want to be autoloadable. |
23 | - config.autoload_paths += [Rails.root.join("app/models/issue_trackers"), Rails.root.join('lib')] | 23 | + config.autoload_paths += [Rails.root.join('lib')] |
24 | 24 | ||
25 | # Only load the plugins named here, in the order given (default is alphabetical). | 25 | # Only load the plugins named here, in the order given (default is alphabetical). |
26 | # :all can be used as a placeholder for all plugins not explicitly named. | 26 | # :all can be used as a placeholder for all plugins not explicitly named. |
config/environments/development.rb
@@ -11,7 +11,6 @@ Errbit::Application.configure do | @@ -11,7 +11,6 @@ Errbit::Application.configure do | ||
11 | 11 | ||
12 | # Show full error reports and disable caching | 12 | # Show full error reports and disable caching |
13 | config.consider_all_requests_local = true | 13 | config.consider_all_requests_local = true |
14 | - config.action_view.debug_rjs = true | ||
15 | config.action_controller.perform_caching = false | 14 | config.action_controller.perform_caching = false |
16 | 15 | ||
17 | # Don't care if the mailer can't send | 16 | # Don't care if the mailer can't send |
lib/issue_tracker_apis/mingle.rb
1 | module Mingle | 1 | module Mingle |
2 | class Card < ActiveResource::Base | 2 | class Card < ActiveResource::Base |
3 | # site template ~> "https://username:password@mingle.example.com/api/v1/projects/:project_id/" | 3 | # site template ~> "https://username:password@mingle.example.com/api/v1/projects/:project_id/" |
4 | + self.format = :xml | ||
4 | end | 5 | end |
5 | def self.set_site(site) | 6 | def self.set_site(site) |
6 | # ActiveResource seems to clone and freeze the @site variable | 7 | # ActiveResource seems to clone and freeze the @site variable |
spec/fabricators/app_fabricator.rb
@@ -22,6 +22,6 @@ Fabricator(:deploy) do | @@ -22,6 +22,6 @@ Fabricator(:deploy) do | ||
22 | username 'clyde.frog' | 22 | username 'clyde.frog' |
23 | repository 'git@github.com/errbit/errbit.git' | 23 | repository 'git@github.com/errbit/errbit.git' |
24 | environment 'production' | 24 | environment 'production' |
25 | - revision { ActiveSupport::SecureRandom.hex(10) } | 25 | + revision { SecureRandom.hex(10) } |
26 | end | 26 | end |
27 | 27 |
spec/fabricators/err_fabricator.rb
@@ -19,7 +19,7 @@ def random_backtrace | @@ -19,7 +19,7 @@ def random_backtrace | ||
19 | backtrace = [] | 19 | backtrace = [] |
20 | 99.times {|t| backtrace << { | 20 | 99.times {|t| backtrace << { |
21 | 'number' => rand(999), | 21 | 'number' => rand(999), |
22 | - 'file' => "/path/to/file/#{ActiveSupport::SecureRandom.hex(4)}.rb", | 22 | + 'file' => "/path/to/file/#{SecureRandom.hex(4)}.rb", |
23 | 'method' => ActiveSupport.methods.shuffle.first | 23 | 'method' => ActiveSupport.methods.shuffle.first |
24 | }} | 24 | }} |
25 | backtrace | 25 | backtrace |
spec/fabricators/issue_tracker_fabricator.rb
@@ -8,19 +8,19 @@ Fabricator :issue_tracker do | @@ -8,19 +8,19 @@ Fabricator :issue_tracker do | ||
8 | end | 8 | end |
9 | 9 | ||
10 | %w(lighthouse pivotal_labs fogbugz).each do |t| | 10 | %w(lighthouse pivotal_labs fogbugz).each do |t| |
11 | - Fabricator "#{t}_tracker".to_sym, :from => :issue_tracker, :class_name => "#{t}_tracker".to_sym | 11 | + Fabricator "#{t}_tracker".to_sym, :from => :issue_tracker, :class_name => "IssueTrackers::#{t.camelcase}Tracker" |
12 | end | 12 | end |
13 | 13 | ||
14 | -Fabricator :redmine_tracker, :from => :issue_tracker, :class_name => :redmine_tracker do | 14 | +Fabricator :redmine_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::RedmineTracker" do |
15 | account 'http://redmine.example.com' | 15 | account 'http://redmine.example.com' |
16 | end | 16 | end |
17 | 17 | ||
18 | -Fabricator :mingle_tracker, :from => :issue_tracker, :class_name => :mingle_tracker do | 18 | +Fabricator :mingle_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::MingleTracker" do |
19 | account 'https://mingle.example.com' | 19 | account 'https://mingle.example.com' |
20 | ticket_properties 'card_type = Defect, defect_status = open, priority = essential' | 20 | ticket_properties 'card_type = Defect, defect_status = open, priority = essential' |
21 | end | 21 | end |
22 | 22 | ||
23 | -Fabricator :github_issues_tracker, :from => :issue_tracker, :class_name => :github_issues_tracker do | 23 | +Fabricator :github_issues_tracker, :from => :issue_tracker, :class_name => "IssueTrackers::GithubIssuesTracker" do |
24 | project_id 'test_account/test_project' | 24 | project_id 'test_account/test_project' |
25 | username 'test_username' | 25 | username 'test_username' |
26 | end | 26 | end |
spec/models/issue_trackers/fogbugz_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe FogbugzTracker do | 3 | +describe IssueTrackers::FogbugzTracker do |
4 | it "should create an issue on Fogbugz with problem params, and set issue link for problem" do | 4 | it "should create an issue on Fogbugz with problem params, and set issue link for problem" do |
5 | notice = Fabricate :notice | 5 | notice = Fabricate :notice |
6 | tracker = Fabricate :fogbugz_tracker, :app => notice.app | 6 | tracker = Fabricate :fogbugz_tracker, :app => notice.app |
spec/models/issue_trackers/github_issues_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe GithubIssuesTracker do | 3 | +describe IssueTrackers::GithubIssuesTracker do |
4 | it "should create an issue on Github Issues with problem params, and set issue link for problem" do | 4 | it "should create an issue on Github Issues with problem params, and set issue link for problem" do |
5 | notice = Fabricate :notice | 5 | notice = Fabricate :notice |
6 | tracker = Fabricate :github_issues_tracker, :app => notice.app | 6 | tracker = Fabricate :github_issues_tracker, :app => notice.app |
spec/models/issue_trackers/lighthouse_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe LighthouseTracker do | 3 | +describe IssueTrackers::LighthouseTracker do |
4 | it "should create an issue on Lighthouse with problem params, and set issue link for problem" do | 4 | it "should create an issue on Lighthouse with problem params, and set issue link for problem" do |
5 | notice = Fabricate :notice | 5 | notice = Fabricate :notice |
6 | tracker = Fabricate :lighthouse_tracker, :app => notice.app | 6 | tracker = Fabricate :lighthouse_tracker, :app => notice.app |
spec/models/issue_trackers/mingle_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe MingleTracker do | 3 | +describe IssueTrackers::MingleTracker do |
4 | it "should create an issue on Mingle with problem params, and set issue link for problem" do | 4 | it "should create an issue on Mingle with problem params, and set issue link for problem" do |
5 | notice = Fabricate :notice | 5 | notice = Fabricate :notice |
6 | tracker = Fabricate :mingle_tracker, :app => notice.app | 6 | tracker = Fabricate :mingle_tracker, :app => notice.app |
spec/models/issue_trackers/pivotal_labs_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe PivotalLabsTracker do | 3 | +describe IssueTrackers::PivotalLabsTracker do |
4 | it "should create an issue on Pivotal Tracker with problem params, and set issue link for problem" do | 4 | it "should create an issue on Pivotal Tracker with problem params, and set issue link for problem" do |
5 | notice = Fabricate :notice | 5 | notice = Fabricate :notice |
6 | tracker = Fabricate :pivotal_labs_tracker, :app => notice.app, :project_id => 10 | 6 | tracker = Fabricate :pivotal_labs_tracker, :app => notice.app, :project_id => 10 |
spec/models/issue_trackers/redmine_tracker_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | -describe RedmineTracker do | 3 | +describe IssueTrackers::RedmineTracker do |
4 | it "should create an issue on Redmine with problem params, and set issue link for problem" do | 4 | it "should create an issue on Redmine with problem params, and set issue link for problem" do |
5 | notice = Fabricate(:notice) | 5 | notice = Fabricate(:notice) |
6 | tracker = Fabricate(:redmine_tracker, :app => notice.app, :project_id => 10) | 6 | tracker = Fabricate(:redmine_tracker, :app => notice.app, :project_id => 10) |
spec/views/errs/show.html.haml_spec.rb
@@ -17,7 +17,7 @@ describe "errs/show.html.haml" do | @@ -17,7 +17,7 @@ describe "errs/show.html.haml" do | ||
17 | 17 | ||
18 | it "should confirm the 'resolve' link by default" do | 18 | it "should confirm the 'resolve' link by default" do |
19 | render | 19 | render |
20 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | 20 | + action_bar = String.new(view.view_flow.get(:action_bar)) |
21 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] | 21 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
22 | resolve_link.should =~ /data-confirm="Seriously\?"/ | 22 | resolve_link.should =~ /data-confirm="Seriously\?"/ |
23 | end | 23 | end |
@@ -25,7 +25,7 @@ describe "errs/show.html.haml" do | @@ -25,7 +25,7 @@ describe "errs/show.html.haml" do | ||
25 | it "should confirm the 'resolve' link if configuration is unset" do | 25 | it "should confirm the 'resolve' link if configuration is unset" do |
26 | Errbit::Config.stub(:confirm_resolve_err).and_return(nil) | 26 | Errbit::Config.stub(:confirm_resolve_err).and_return(nil) |
27 | render | 27 | render |
28 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | 28 | + action_bar = String.new(view.view_flow.get(:action_bar)) |
29 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] | 29 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
30 | resolve_link.should =~ /data-confirm="Seriously\?"/ | 30 | resolve_link.should =~ /data-confirm="Seriously\?"/ |
31 | end | 31 | end |
@@ -33,7 +33,7 @@ describe "errs/show.html.haml" do | @@ -33,7 +33,7 @@ describe "errs/show.html.haml" do | ||
33 | it "should not confirm the 'resolve' link if configured not to" do | 33 | it "should not confirm the 'resolve' link if configured not to" do |
34 | Errbit::Config.stub(:confirm_resolve_err).and_return(false) | 34 | Errbit::Config.stub(:confirm_resolve_err).and_return(false) |
35 | render | 35 | render |
36 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | 36 | + action_bar = String.new(view.view_flow.get(:action_bar)) |
37 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] | 37 | resolve_link = action_bar.match(/(<a href.*?(class="resolve").*?>)/)[0] |
38 | resolve_link.should_not =~ /data-confirm=/ | 38 | resolve_link.should_not =~ /data-confirm=/ |
39 | end | 39 | end |
@@ -42,7 +42,7 @@ describe "errs/show.html.haml" do | @@ -42,7 +42,7 @@ describe "errs/show.html.haml" do | ||
42 | url = 'http://localhost:3000/errs' | 42 | url = 'http://localhost:3000/errs' |
43 | controller.request.env['HTTP_REFERER'] = url | 43 | controller.request.env['HTTP_REFERER'] = url |
44 | render | 44 | render |
45 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | 45 | + action_bar = String.new(view.view_flow.get(:action_bar)) |
46 | action_bar.should =~ /<span><a href=\"#{url}\" class=\"up\">up<\/a><\/span>/ | 46 | action_bar.should =~ /<span><a href=\"#{url}\" class=\"up\">up<\/a><\/span>/ |
47 | end | 47 | end |
48 | 48 | ||
@@ -52,7 +52,7 @@ describe "errs/show.html.haml" do | @@ -52,7 +52,7 @@ describe "errs/show.html.haml" do | ||
52 | assign :problem, problem | 52 | assign :problem, problem |
53 | assign :app, problem.app | 53 | assign :app, problem.app |
54 | render | 54 | render |
55 | - action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | 55 | + action_bar = String.new(view.view_flow.get(:action_bar)) |
56 | action_bar.should =~ /<span><a href=\"#{app_errs_path(problem.app)}\" class=\"up\">up<\/a><\/span>/ | 56 | action_bar.should =~ /<span><a href=\"#{app_errs_path(problem.app)}\" class=\"up\">up<\/a><\/span>/ |
57 | end | 57 | end |
58 | 58 | ||
@@ -68,7 +68,7 @@ describe "errs/show.html.haml" do | @@ -68,7 +68,7 @@ describe "errs/show.html.haml" do | ||
68 | assign :problem, problem | 68 | assign :problem, problem |
69 | assign :app, problem.app | 69 | assign :app, problem.app |
70 | render | 70 | render |
71 | - comments_section = String.new(view.instance_variable_get(:@_content_for)[:comments]) | 71 | + comments_section = String.new(view.view_flow.get(:comments)) |
72 | comments_section.should =~ /Test comment/ | 72 | comments_section.should =~ /Test comment/ |
73 | comments_section.should =~ /Add a comment/ | 73 | comments_section.should =~ /Add a comment/ |
74 | end | 74 | end |
@@ -84,7 +84,7 @@ describe "errs/show.html.haml" do | @@ -84,7 +84,7 @@ describe "errs/show.html.haml" do | ||
84 | problem = Fabricate(:problem) | 84 | problem = Fabricate(:problem) |
85 | with_issue_tracker(problem) | 85 | with_issue_tracker(problem) |
86 | render | 86 | render |
87 | - view.instance_variable_get(:@_content_for)[:comments].should be_blank | 87 | + view.view_flow.get(:comments).should be_blank |
88 | end | 88 | end |
89 | 89 | ||
90 | it 'should display existing comments' do | 90 | it 'should display existing comments' do |
@@ -92,7 +92,7 @@ describe "errs/show.html.haml" do | @@ -92,7 +92,7 @@ describe "errs/show.html.haml" do | ||
92 | problem.reload | 92 | problem.reload |
93 | with_issue_tracker(problem) | 93 | with_issue_tracker(problem) |
94 | render | 94 | render |
95 | - comments_section = String.new(view.instance_variable_get(:@_content_for)[:comments]) | 95 | + comments_section = String.new(view.view_flow.get(:comments)) |
96 | comments_section.should =~ /Test comment/ | 96 | comments_section.should =~ /Test comment/ |
97 | comments_section.should_not =~ /Add a comment/ | 97 | comments_section.should_not =~ /Add a comment/ |
98 | end | 98 | end |