trusty-cms 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +91 -95
  3. data/LICENSE.md +1 -1
  4. data/app/helpers/admin/node_helper.rb +1 -1
  5. data/app/models/asset.rb +3 -3
  6. data/app/models/page.rb +3 -3
  7. data/app/models/standard_tags.rb +3 -3
  8. data/app/models/user.rb +1 -1
  9. data/config/database.mysql.yml +10 -2
  10. data/db/migrate/20210331134718_create_active_storage_tables.active_storage.rb +36 -0
  11. data/lib/generators/extension/templates/test_helper.rb +6 -8
  12. data/lib/login_system.rb +1 -1
  13. data/lib/trusty_cms.rb +1 -1
  14. data/spec/dummy/config/database.yml +6 -2
  15. data/trusty_cms.gemspec +2 -3
  16. data/vendor/extensions/clipped-extension/lib/asset_tags.rb +4 -4
  17. metadata +9 -174
  18. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/base.rb +0 -195
  19. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/check_box.rb +0 -65
  20. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/checkable.rb +0 -18
  21. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -35
  22. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_helpers.rb +0 -118
  23. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -30
  24. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_select.rb +0 -30
  25. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/color_field.rb +0 -26
  26. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_field.rb +0 -14
  27. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_select.rb +0 -73
  28. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_field.rb +0 -31
  29. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_local_field.rb +0 -20
  30. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_select.rb +0 -10
  31. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/email_field.rb +0 -10
  32. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/file_field.rb +0 -10
  33. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -31
  34. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/hidden_field.rb +0 -10
  35. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/label.rb +0 -80
  36. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/month_field.rb +0 -14
  37. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb +0 -20
  38. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/password_field.rb +0 -14
  39. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/placeholderable.rb +0 -24
  40. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb +0 -32
  41. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/range_field.rb +0 -10
  42. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb +0 -27
  43. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb +0 -42
  44. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/tel_field.rb +0 -10
  45. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb +0 -24
  46. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb +0 -33
  47. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_field.rb +0 -14
  48. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_select.rb +0 -10
  49. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_zone_select.rb +0 -22
  50. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/translator.rb +0 -39
  51. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/url_field.rb +0 -10
  52. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/week_field.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97e7e4f174a6b755702f6743fc5c4bed0a9f2384e266e3874b52eeab89df84b8
4
- data.tar.gz: 59dfd764929a52eddf268255dba421eaaa4b90227e2cb04b07c66abc547b7bc1
3
+ metadata.gz: d92ba06bde5529d4765f3383b8724063f42b760909be7630b51d4277fe28e66d
4
+ data.tar.gz: 0227a9f6118266789d256df74f3d7672333079585b41b7a73a07911b97c2340b
5
5
  SHA512:
6
- metadata.gz: '083f2fd54a713baf10dc16d0ea3773a9ffe002b3ffdca09771e28c1b81a55511d106bb55bd231165548cacc2dfec9c0bc6157f2db9ecb177af36c0729c0269a2'
7
- data.tar.gz: d0707e8e683982348b672b9dd3eaa16802c82c27565ac0c8b709d6828a2b01942c7fe46b4954f1954290e9f282c6b3ae198ab9030686ac44a63e5c3a6e50820b
6
+ metadata.gz: 626c2a0eb4a13092ab342e039b3a8745307e8f842b6bdb1476d0e93c7f9b11ad9a7100ecb21816332b07dd215d8fddda0603ddc85230389d8d0bc3103113bdf3
7
+ data.tar.gz: a7f225c262b5c51128eb1438a84fbf37d0ea77562357e4979e0da998a3bdaf15c3f50d366b2fc892345b4c063c0c6c9a1ea18e46beb45fb422247cc3e22eb520
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (4.2.1)
4
+ trusty-cms (4.2.2)
5
5
  RedCloth (= 4.3.2)
6
6
  acts_as_list (>= 0.9.5, < 1.1.0)
7
7
  acts_as_tree (>= 2.6.1, < 2.9.0)
@@ -10,12 +10,11 @@ PATH
10
10
  devise
11
11
  execjs (~> 2.7)
12
12
  haml
13
- haml-rails
13
+ haml-rails (~> 2.0)
14
14
  highline (>= 1.7.8, < 2.1.0)
15
15
  kraken-io
16
16
  mini_racer
17
17
  mysql2
18
- paperclip (> 5.2)
19
18
  rack (>= 2.0.1, < 2.3.0)
20
19
  rack-cache (~> 1.7)
21
20
  radius (~> 0.7)
@@ -23,7 +22,7 @@ PATH
23
22
  rake (< 14.0)
24
23
  rdoc (>= 5.1, < 7.0)
25
24
  roadie-rails
26
- sassc-rails
25
+ sass-rails
27
26
  stringex (>= 2.7.1, < 2.9.0)
28
27
  tzinfo (>= 1.2.3, < 2.1.0)
29
28
  uglifier (>= 3.2, < 5.0)
@@ -34,60 +33,60 @@ GEM
34
33
  remote: https://rubygems.org/
35
34
  specs:
36
35
  RedCloth (4.3.2)
37
- actioncable (6.1.1)
38
- actionpack (= 6.1.1)
39
- activesupport (= 6.1.1)
36
+ actioncable (6.1.3.1)
37
+ actionpack (= 6.1.3.1)
38
+ activesupport (= 6.1.3.1)
40
39
  nio4r (~> 2.0)
41
40
  websocket-driver (>= 0.6.1)
42
- actionmailbox (6.1.1)
43
- actionpack (= 6.1.1)
44
- activejob (= 6.1.1)
45
- activerecord (= 6.1.1)
46
- activestorage (= 6.1.1)
47
- activesupport (= 6.1.1)
41
+ actionmailbox (6.1.3.1)
42
+ actionpack (= 6.1.3.1)
43
+ activejob (= 6.1.3.1)
44
+ activerecord (= 6.1.3.1)
45
+ activestorage (= 6.1.3.1)
46
+ activesupport (= 6.1.3.1)
48
47
  mail (>= 2.7.1)
49
- actionmailer (6.1.1)
50
- actionpack (= 6.1.1)
51
- actionview (= 6.1.1)
52
- activejob (= 6.1.1)
53
- activesupport (= 6.1.1)
48
+ actionmailer (6.1.3.1)
49
+ actionpack (= 6.1.3.1)
50
+ actionview (= 6.1.3.1)
51
+ activejob (= 6.1.3.1)
52
+ activesupport (= 6.1.3.1)
54
53
  mail (~> 2.5, >= 2.5.4)
55
54
  rails-dom-testing (~> 2.0)
56
- actionpack (6.1.1)
57
- actionview (= 6.1.1)
58
- activesupport (= 6.1.1)
55
+ actionpack (6.1.3.1)
56
+ actionview (= 6.1.3.1)
57
+ activesupport (= 6.1.3.1)
59
58
  rack (~> 2.0, >= 2.0.9)
60
59
  rack-test (>= 0.6.3)
61
60
  rails-dom-testing (~> 2.0)
62
61
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
63
- actiontext (6.1.1)
64
- actionpack (= 6.1.1)
65
- activerecord (= 6.1.1)
66
- activestorage (= 6.1.1)
67
- activesupport (= 6.1.1)
62
+ actiontext (6.1.3.1)
63
+ actionpack (= 6.1.3.1)
64
+ activerecord (= 6.1.3.1)
65
+ activestorage (= 6.1.3.1)
66
+ activesupport (= 6.1.3.1)
68
67
  nokogiri (>= 1.8.5)
69
- actionview (6.1.1)
70
- activesupport (= 6.1.1)
68
+ actionview (6.1.3.1)
69
+ activesupport (= 6.1.3.1)
71
70
  builder (~> 3.1)
72
71
  erubi (~> 1.4)
73
72
  rails-dom-testing (~> 2.0)
74
73
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
75
- activejob (6.1.1)
76
- activesupport (= 6.1.1)
74
+ activejob (6.1.3.1)
75
+ activesupport (= 6.1.3.1)
77
76
  globalid (>= 0.3.6)
78
- activemodel (6.1.1)
79
- activesupport (= 6.1.1)
80
- activerecord (6.1.1)
81
- activemodel (= 6.1.1)
82
- activesupport (= 6.1.1)
83
- activestorage (6.1.1)
84
- actionpack (= 6.1.1)
85
- activejob (= 6.1.1)
86
- activerecord (= 6.1.1)
87
- activesupport (= 6.1.1)
88
- marcel (~> 0.3.1)
89
- mimemagic (~> 0.3.2)
90
- activesupport (6.1.1)
77
+ activemodel (6.1.3.1)
78
+ activesupport (= 6.1.3.1)
79
+ activerecord (6.1.3.1)
80
+ activemodel (= 6.1.3.1)
81
+ activesupport (= 6.1.3.1)
82
+ activestorage (6.1.3.1)
83
+ actionpack (= 6.1.3.1)
84
+ activejob (= 6.1.3.1)
85
+ activerecord (= 6.1.3.1)
86
+ activesupport (= 6.1.3.1)
87
+ marcel (~> 1.0.0)
88
+ mini_mime (~> 1.0.2)
89
+ activesupport (6.1.3.1)
91
90
  concurrent-ruby (~> 1.0, >= 1.0.2)
92
91
  i18n (>= 1.6, < 2)
93
92
  minitest (>= 5.1)
@@ -102,13 +101,13 @@ GEM
102
101
  bcrypt (3.1.16)
103
102
  builder (3.2.4)
104
103
  byebug (11.1.3)
105
- capybara (3.34.0)
104
+ capybara (3.35.3)
106
105
  addressable
107
106
  mini_mime (>= 0.1.3)
108
107
  nokogiri (~> 1.8)
109
108
  rack (>= 1.6.0)
110
109
  rack-test (>= 0.6.3)
111
- regexp_parser (~> 1.5)
110
+ regexp_parser (>= 1.5, < 3.0)
112
111
  xpath (~> 3.2)
113
112
  ckeditor (4.2.4)
114
113
  cocaine
@@ -118,11 +117,16 @@ GEM
118
117
  cocaine (0.6.0)
119
118
  terrapin (= 0.6.0)
120
119
  coderay (1.1.3)
121
- concurrent-ruby (1.1.7)
120
+ concurrent-ruby (1.1.8)
122
121
  crass (1.0.6)
123
- css_parser (1.7.1)
122
+ css_parser (1.9.0)
124
123
  addressable
125
- database_cleaner (1.8.5)
124
+ database_cleaner (2.0.1)
125
+ database_cleaner-active_record (~> 2.0.0)
126
+ database_cleaner-active_record (2.0.0)
127
+ activerecord (>= 5.a)
128
+ database_cleaner-core (~> 2.0.0)
129
+ database_cleaner-core (2.0.1)
126
130
  delocalize (1.2.0)
127
131
  rails (>= 2)
128
132
  devise (4.7.3)
@@ -132,7 +136,7 @@ GEM
132
136
  responders
133
137
  warden (~> 1.2.3)
134
138
  diff-lcs (1.4.4)
135
- docile (1.3.4)
139
+ docile (1.3.5)
136
140
  erubi (1.10.0)
137
141
  erubis (2.7.0)
138
142
  execjs (2.7.0)
@@ -141,7 +145,7 @@ GEM
141
145
  factory_bot_rails (6.1.0)
142
146
  factory_bot (~> 6.1.0)
143
147
  railties (>= 5.0.0)
144
- ffi (1.14.2)
148
+ ffi (1.15.0)
145
149
  globalid (0.4.2)
146
150
  activesupport (>= 4.2.0)
147
151
  haml (5.2.1)
@@ -162,7 +166,7 @@ GEM
162
166
  httparty (0.18.1)
163
167
  mime-types (~> 3.0)
164
168
  multi_xml (>= 0.5.2)
165
- i18n (1.8.7)
169
+ i18n (1.8.10)
166
170
  concurrent-ruby (~> 1.0)
167
171
  json (2.5.1)
168
172
  kraken-io (0.1.3)
@@ -172,38 +176,28 @@ GEM
172
176
  multipart-post
173
177
  launchy (2.5.0)
174
178
  addressable (~> 2.7)
175
- libv8 (8.4.255.0)
176
- loofah (2.8.0)
179
+ libv8 (8.4.255.0-x86_64-darwin-20)
180
+ loofah (2.9.0)
177
181
  crass (~> 1.0.2)
178
182
  nokogiri (>= 1.5.9)
179
183
  mail (2.7.1)
180
184
  mini_mime (>= 0.1.1)
181
- marcel (0.3.3)
182
- mimemagic (~> 0.3.2)
185
+ marcel (1.0.0)
183
186
  method_source (1.0.0)
184
187
  mime-types (3.3.1)
185
188
  mime-types-data (~> 3.2015)
186
- mime-types-data (3.2020.1104)
187
- mimemagic (0.3.5)
188
- mini_mime (1.0.2)
189
- mini_portile2 (2.5.0)
189
+ mime-types-data (3.2021.0225)
190
+ mini_mime (1.0.3)
190
191
  mini_racer (0.3.1)
191
192
  libv8 (~> 8.4.255)
192
- minitest (5.14.3)
193
+ minitest (5.14.4)
193
194
  multi_xml (0.6.0)
194
195
  multipart-post (2.1.1)
195
196
  mysql2 (0.5.3)
196
- nio4r (2.5.4)
197
- nokogiri (1.11.1)
198
- mini_portile2 (~> 2.5.0)
197
+ nio4r (2.5.7)
198
+ nokogiri (1.11.2-x86_64-darwin)
199
199
  racc (~> 1.4)
200
200
  orm_adapter (0.5.0)
201
- paperclip (6.1.0)
202
- activemodel (>= 4.2.0)
203
- activesupport (>= 4.2.0)
204
- mime-types
205
- mimemagic (~> 0.3.0)
206
- terrapin (~> 0.6.0)
207
201
  poltergeist (1.18.1)
208
202
  capybara (>= 2.1, < 4)
209
203
  cliver (~> 0.3.1)
@@ -222,20 +216,20 @@ GEM
222
216
  rack-test (1.1.0)
223
217
  rack (>= 1.0, < 3)
224
218
  radius (0.7.5)
225
- rails (6.1.1)
226
- actioncable (= 6.1.1)
227
- actionmailbox (= 6.1.1)
228
- actionmailer (= 6.1.1)
229
- actionpack (= 6.1.1)
230
- actiontext (= 6.1.1)
231
- actionview (= 6.1.1)
232
- activejob (= 6.1.1)
233
- activemodel (= 6.1.1)
234
- activerecord (= 6.1.1)
235
- activestorage (= 6.1.1)
236
- activesupport (= 6.1.1)
219
+ rails (6.1.3.1)
220
+ actioncable (= 6.1.3.1)
221
+ actionmailbox (= 6.1.3.1)
222
+ actionmailer (= 6.1.3.1)
223
+ actionpack (= 6.1.3.1)
224
+ actiontext (= 6.1.3.1)
225
+ actionview (= 6.1.3.1)
226
+ activejob (= 6.1.3.1)
227
+ activemodel (= 6.1.3.1)
228
+ activerecord (= 6.1.3.1)
229
+ activestorage (= 6.1.3.1)
230
+ activesupport (= 6.1.3.1)
237
231
  bundler (>= 1.15.0)
238
- railties (= 6.1.1)
232
+ railties (= 6.1.3.1)
239
233
  sprockets-rails (>= 2.0.0)
240
234
  rails-dom-testing (2.0.3)
241
235
  activesupport (>= 4.2.0)
@@ -244,15 +238,15 @@ GEM
244
238
  loofah (~> 2.3)
245
239
  rails-observers (0.1.5)
246
240
  activemodel (>= 4.0)
247
- railties (6.1.1)
248
- actionpack (= 6.1.1)
249
- activesupport (= 6.1.1)
241
+ railties (6.1.3.1)
242
+ actionpack (= 6.1.3.1)
243
+ activesupport (= 6.1.3.1)
250
244
  method_source
251
245
  rake (>= 0.8.7)
252
246
  thor (~> 1.0)
253
247
  rake (13.0.3)
254
248
  rdoc (6.3.0)
255
- regexp_parser (1.8.2)
249
+ regexp_parser (2.1.1)
256
250
  responders (3.0.1)
257
251
  actionpack (>= 5.0)
258
252
  railties (>= 5.0)
@@ -267,20 +261,22 @@ GEM
267
261
  rspec-expectations (3.10.1)
268
262
  diff-lcs (>= 1.2.0, < 2.0)
269
263
  rspec-support (~> 3.10.0)
270
- rspec-mocks (3.10.1)
264
+ rspec-mocks (3.10.2)
271
265
  diff-lcs (>= 1.2.0, < 2.0)
272
266
  rspec-support (~> 3.10.0)
273
- rspec-rails (4.0.2)
274
- actionpack (>= 4.2)
275
- activesupport (>= 4.2)
276
- railties (>= 4.2)
267
+ rspec-rails (5.0.1)
268
+ actionpack (>= 5.2)
269
+ activesupport (>= 5.2)
270
+ railties (>= 5.2)
277
271
  rspec-core (~> 3.10)
278
272
  rspec-expectations (~> 3.10)
279
273
  rspec-mocks (~> 3.10)
280
274
  rspec-support (~> 3.10)
281
- rspec-support (3.10.1)
275
+ rspec-support (3.10.2)
282
276
  ruby_parser (3.15.1)
283
277
  sexp_processor (~> 4.9)
278
+ sass-rails (6.0.0)
279
+ sassc-rails (~> 2.1, >= 2.1.1)
284
280
  sassc (2.4.0)
285
281
  ffi (~> 1.9)
286
282
  sassc-rails (2.1.2)
@@ -307,7 +303,7 @@ GEM
307
303
  temple (0.8.2)
308
304
  terrapin (0.6.0)
309
305
  climate_control (>= 0.0.3, < 1.0)
310
- thor (1.0.1)
306
+ thor (1.1.0)
311
307
  tilt (2.0.10)
312
308
  trustygems (0.2.1)
313
309
  rake
@@ -327,7 +323,7 @@ GEM
327
323
  zeitwerk (2.4.2)
328
324
 
329
325
  PLATFORMS
330
- ruby
326
+ x86_64-darwin-20
331
327
 
332
328
  DEPENDENCIES
333
329
  acts_as_list
@@ -344,4 +340,4 @@ DEPENDENCIES
344
340
  trustygems (~> 0.2.0)
345
341
 
346
342
  BUNDLED WITH
347
- 2.1.4
343
+ 2.2.15
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2006-2009, John W. Long and Sean D. Cribbs.
3
+ Copyright (c) 2006-2021, John W. Long and Sean D. Cribbs.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -10,7 +10,7 @@ module Admin::NodeHelper
10
10
 
11
11
  @rendered_html += (render partial: 'admin/pages/node',
12
12
  locals: { level: index, index: index, parent_index: parent_index,
13
- page: page, simple: simple, branch: (page.children.count > 0) })
13
+ page: page, simple: simple, branch: (page.children.count.positive?) })
14
14
  index
15
15
  end
16
16
 
data/app/models/asset.rb CHANGED
@@ -74,12 +74,12 @@ class Asset < ActiveRecord::Base
74
74
 
75
75
  def thumbnail(style_name = 'original')
76
76
  return asset.url if style_name.to_sym == :original
77
- return asset.url(style_name.to_sym) if has_style?(style_name)
77
+ return asset.url(style_name.to_sym) if style?(style_name)
78
78
 
79
79
  asset_type.icon(style_name)
80
80
  end
81
81
 
82
- def has_style?(style_name = 'original')
82
+ def style?(style_name = 'original')
83
83
  style_name == 'original' || paperclip_styles.keys.include?(style_name.to_sym)
84
84
  end
85
85
 
@@ -110,7 +110,7 @@ class Asset < ActiveRecord::Base
110
110
  end
111
111
 
112
112
  def geometry(style_name = 'original')
113
- raise Paperclip::StyleError, "Requested style #{style_name} is not defined for this asset." unless has_style?(style_name)
113
+ raise Paperclip::StyleError, "Requested style #{style_name} is not defined for this asset." unless style?(style_name)
114
114
 
115
115
  @geometry ||= {}
116
116
  begin
data/app/models/page.rb CHANGED
@@ -76,16 +76,16 @@ class Page < ActiveRecord::Base
76
76
  end
77
77
  end
78
78
 
79
- def has_part?(name)
79
+ def part?(name)
80
80
  !part(name).nil?
81
81
  end
82
82
 
83
83
  def has_or_inherits_part?(name)
84
- has_part?(name) || inherits_part?(name)
84
+ part?(name) || inherits_part?(name)
85
85
  end
86
86
 
87
87
  def inherits_part?(name)
88
- !has_part?(name) && ancestors.any? { |page| page.has_part?(name) }
88
+ !part?(name) && ancestors.any? { |page| page.part?(name) }
89
89
  end
90
90
 
91
91
  def field(name)
@@ -312,7 +312,7 @@ module StandardTags
312
312
  }
313
313
  tag 'if_children' do |tag|
314
314
  children = tag.locals.page.children.where(children_find_options(tag)[:conditions]).count
315
- tag.expand if children > 0
315
+ tag.expand if children.positive?
316
316
  end
317
317
 
318
318
  desc %{
@@ -327,7 +327,7 @@ module StandardTags
327
327
  }
328
328
  tag 'unless_children' do |tag|
329
329
  children = tag.locals.page.children.where(children_find_options(tag)[:conditions]).count
330
- tag.expand unless children > 0
330
+ tag.expand unless children.positive?
331
331
  end
332
332
 
333
333
  desc %{
@@ -961,7 +961,7 @@ module StandardTags
961
961
  page_path = remove_trailing_slash(path)
962
962
  hash[:title] = title
963
963
  hash[:path] = path
964
- tag.locals.first_child = i == 0
964
+ tag.locals.first_child = i.zero?
965
965
  tag.locals.last_child = i == pairs.length - 1
966
966
  result << case page_path
967
967
  when compare_path
data/app/models/user.rb CHANGED
@@ -19,7 +19,7 @@ class User < ActiveRecord::Base
19
19
  belongs_to :created_by, class_name: 'User'
20
20
  belongs_to :updated_by, class_name: 'User'
21
21
 
22
- def has_role?(role)
22
+ def role?(role)
23
23
  case role
24
24
  when :admin
25
25
  admin?