spina-admin-conferences 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -10
- data/app/assets/config/spina_admin_conferences_manifest.js +4 -2
- data/app/assets/javascripts/{spina/admin/conferences/controllers/conference_events_form_controller.es6 → controllers/spina/admin/conferences/conference_events_form_controller.js} +3 -4
- data/app/assets/javascripts/{spina/admin/conferences/controllers/presentation_attachments_form_controller.es6 → controllers/spina/admin/conferences/presentation_attachments_form_controller.js} +3 -4
- data/app/assets/javascripts/{spina/admin/conferences/controllers/select_options_controller.es6 → controllers/spina/admin/conferences/select_options_controller.js} +8 -9
- data/app/assets/javascripts/importmap.json.erb +6 -0
- data/app/assets/javascripts/spina/admin/conferences/application.js +4 -0
- data/app/assets/stylesheets/spina/admin/conferences/application.sass +4 -0
- data/app/controllers/spina/admin/conferences/application_controller.rb +1 -1
- data/app/controllers/spina/admin/conferences/conferences_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/delegates_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/institutions_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/presentations_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/rooms_controller.rb +3 -3
- data/app/controllers/spina/admin/conferences/sessions_controller.rb +3 -3
- data/app/views/layouts/spina/admin/conferences/application.html.haml +6 -0
- data/app/views/layouts/spina/admin/conferences/conferences.html.haml +2 -4
- data/app/views/layouts/spina/admin/conferences/delegates.html.haml +2 -4
- data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +2 -4
- data/app/views/layouts/spina/admin/conferences/institutions.html.haml +2 -4
- data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +2 -4
- data/app/views/layouts/spina/admin/conferences/presentations.html.haml +2 -4
- data/app/views/spina/admin/conferences/application/_errors.turbo_stream.haml +1 -0
- data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +3 -4
- data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +2 -2
- data/app/views/spina/admin/conferences/conferences/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +7 -7
- data/app/views/spina/admin/conferences/delegates/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +1 -1
- data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +1 -1
- data/app/views/spina/admin/conferences/events/new.js.erb +3 -9
- data/app/views/spina/admin/conferences/institutions/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +1 -1
- data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +2 -2
- data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +3 -3
- data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +2 -2
- data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +4 -4
- data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +2 -2
- data/app/views/spina/admin/conferences/presentations/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +9 -9
- data/app/views/spina/admin/conferences/rooms/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +1 -1
- data/app/views/spina/admin/conferences/sessions/_form.html.haml +1 -1
- data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +7 -7
- data/app/views/spina/admin/hooks/conferences/_head.html.haml +5 -0
- data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +15 -14
- data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +4 -2
- data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +1 -1
- data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +1 -1
- data/config/initializers/assets.rb +1 -1
- data/lib/spina/admin/conferences.rb +2 -0
- data/lib/spina/admin/conferences/version.rb +1 -1
- metadata +65 -37
- data/app/assets/javascripts/spina/admin/conferences/application.es6 +0 -20
- data/app/views/spina/admin/conferences/application/_errors.js.erb +0 -2
- data/config/initializers/types.rb +0 -13
- data/lib/spina/admin/conferences/types/interval_type.rb +0 -29
@@ -1,20 +1,21 @@
|
|
1
|
-
%li{
|
1
|
+
%li#conferences-primary-navigation{ data: { turbolinks: 'false', turbo: 'permanent' },
|
2
|
+
class: ('active' if %w[conferences delegates presentations presentation_types institutions rooms].include? controller_name) }
|
2
3
|
= link_to admin_conferences_presentations_path do
|
3
4
|
= icon('comment')
|
4
5
|
= t("spina.admin.conferences.title")
|
5
6
|
= icon('caret-right')
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
%ul
|
9
|
+
%li{ class: ('active' if %w[institutions rooms].include? controller_name) }
|
10
|
+
= link_to Spina::Admin::Conferences::Institution.model_name.human(count: 0), spina.admin_conferences_institutions_path
|
11
|
+
%li{ class: ('active' if %w[conferences presentation_types sessions].include? controller_name) }
|
12
|
+
= link_to Spina::Admin::Conferences::Conference.model_name.human(count: 0), spina.admin_conferences_conferences_path
|
13
|
+
%li{ class: ('active' if %w[delegates].include? controller_name) }
|
14
|
+
= link_to Spina::Admin::Conferences::Delegate.model_name.human(count: 0), spina.admin_conferences_delegates_path
|
15
|
+
%li{ class: ('active' if %w[presentations].include? controller_name) }
|
16
|
+
= link_to Spina::Admin::Conferences::Presentation.model_name.human(count: 0), spina.admin_conferences_presentations_path
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
%li
|
19
|
+
= link_to '#', class: 'back-to-main-menu' do
|
20
|
+
= icon('caret-left')
|
21
|
+
=t 'spina.main_menu'
|
@@ -1,4 +1,6 @@
|
|
1
1
|
%li{ class: ('active' if %w[dietary_requirements].include? controller_name) }
|
2
|
-
= link_to Spina::Admin::Conferences::DietaryRequirement.model_name.human(count: 0), spina.admin_conferences_dietary_requirements_path
|
2
|
+
= link_to Spina::Admin::Conferences::DietaryRequirement.model_name.human(count: 0), spina.admin_conferences_dietary_requirements_path,
|
3
|
+
data: { turbolinks: 'false' }
|
3
4
|
%li{ class: ('active' if %w[presentation_attachment_types].include? controller_name) }
|
4
|
-
= link_to Spina::Admin::Conferences::PresentationAttachmentType.model_name.human(count: 0), spina.admin_conferences_presentation_attachment_types_path
|
5
|
+
= link_to Spina::Admin::Conferences::PresentationAttachmentType.model_name.human(count: 0), spina.admin_conferences_presentation_attachment_types_path,
|
6
|
+
data: { turbolinks: 'false' }
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Add additional assets to the asset load path.
|
6
6
|
# Rails.application.config.assets.paths << Emoji.images_path
|
7
7
|
# Add Yarn node_modules folder to the asset load path.
|
8
|
-
Rails.application.config.assets.paths << Spina::Admin::Conferences::Engine.root.join('node_modules')
|
8
|
+
# Rails.application.config.assets.paths << Spina::Admin::Conferences::Engine.root.join('node_modules')
|
9
9
|
|
10
10
|
# Precompile additional assets.
|
11
11
|
# application.js, application.css, and all non-JS/CSS in the app/assets
|
metadata
CHANGED
@@ -1,127 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spina-admin-conferences
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Malčić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: icalendar
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '6.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rails-i18n
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '6.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '6.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: redis
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '4.2'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '4.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: spina
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '1.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: stimulus-rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.2.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.2.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: turbo-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
103
|
+
version: 0.5.9
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.5.9
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: capybara
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '3.33'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '3.33'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: dotenv-rails
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,14 +226,14 @@ dependencies:
|
|
226
226
|
requirements:
|
227
227
|
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
229
|
+
version: '1.8'
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
236
|
+
version: '1.8'
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: rubocop-performance
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,6 +276,20 @@ dependencies:
|
|
276
276
|
- - "~>"
|
277
277
|
- !ruby/object:Gem::Version
|
278
278
|
version: '3.142'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: sidekiq
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - "~>"
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '6.1'
|
286
|
+
type: :development
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - "~>"
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '6.1'
|
279
293
|
- !ruby/object:Gem::Dependency
|
280
294
|
name: simplecov
|
281
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -290,6 +304,20 @@ dependencies:
|
|
290
304
|
- - "~>"
|
291
305
|
- !ruby/object:Gem::Version
|
292
306
|
version: '0.19'
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: simplecov-lcov
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - "~>"
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: '0.8'
|
314
|
+
type: :development
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - "~>"
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '0.8'
|
293
321
|
- !ruby/object:Gem::Dependency
|
294
322
|
name: web-console
|
295
323
|
requirement: !ruby/object:Gem::Requirement
|
@@ -329,10 +357,11 @@ files:
|
|
329
357
|
- README.md
|
330
358
|
- Rakefile
|
331
359
|
- app/assets/config/spina_admin_conferences_manifest.js
|
332
|
-
- app/assets/javascripts/spina/admin/conferences/
|
333
|
-
- app/assets/javascripts/spina/admin/conferences/
|
334
|
-
- app/assets/javascripts/spina/admin/conferences/
|
335
|
-
- app/assets/javascripts/
|
360
|
+
- app/assets/javascripts/controllers/spina/admin/conferences/conference_events_form_controller.js
|
361
|
+
- app/assets/javascripts/controllers/spina/admin/conferences/presentation_attachments_form_controller.js
|
362
|
+
- app/assets/javascripts/controllers/spina/admin/conferences/select_options_controller.js
|
363
|
+
- app/assets/javascripts/importmap.json.erb
|
364
|
+
- app/assets/javascripts/spina/admin/conferences/application.js
|
336
365
|
- app/assets/stylesheets/spina/admin/conferences/application.sass
|
337
366
|
- app/controllers/spina/admin/conferences/application_controller.rb
|
338
367
|
- app/controllers/spina/admin/conferences/conferences_controller.rb
|
@@ -375,6 +404,7 @@ files:
|
|
375
404
|
- app/validators/spina/admin/conferences/finish_date_validator.rb
|
376
405
|
- app/validators/spina/admin/conferences/finish_time_validator.rb
|
377
406
|
- app/validators/spina/admin/conferences/http_url_validator.rb
|
407
|
+
- app/views/layouts/spina/admin/conferences/application.html.haml
|
378
408
|
- app/views/layouts/spina/admin/conferences/conferences.html.haml
|
379
409
|
- app/views/layouts/spina/admin/conferences/delegates.html.haml
|
380
410
|
- app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml
|
@@ -383,7 +413,7 @@ files:
|
|
383
413
|
- app/views/layouts/spina/admin/conferences/presentations.html.haml
|
384
414
|
- app/views/spina/admin/conferences/application/_empty_list.html.haml
|
385
415
|
- app/views/spina/admin/conferences/application/_errors.html.haml
|
386
|
-
- app/views/spina/admin/conferences/application/_errors.
|
416
|
+
- app/views/spina/admin/conferences/application/_errors.turbo_stream.haml
|
387
417
|
- app/views/spina/admin/conferences/conferences/_conference.html.haml
|
388
418
|
- app/views/spina/admin/conferences/conferences/_event_fields.html.haml
|
389
419
|
- app/views/spina/admin/conferences/conferences/_event_row.html.haml
|
@@ -468,7 +498,6 @@ files:
|
|
468
498
|
- app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml
|
469
499
|
- app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml
|
470
500
|
- config/initializers/assets.rb
|
471
|
-
- config/initializers/types.rb
|
472
501
|
- config/locales/en.yml
|
473
502
|
- config/routes.rb
|
474
503
|
- db/migrate/20180907141228_create_spina_dates.rb
|
@@ -532,7 +561,6 @@ files:
|
|
532
561
|
- lib/spina/admin/conferences/engine.rb
|
533
562
|
- lib/spina/admin/conferences/migration/renaming.rb
|
534
563
|
- lib/spina/admin/conferences/railtie.rb
|
535
|
-
- lib/spina/admin/conferences/types/interval_type.rb
|
536
564
|
- lib/spina/admin/conferences/version.rb
|
537
565
|
- lib/tasks/spina/admin/conferences_tasks.rake
|
538
566
|
homepage: https://jmalcic.github.io/projects/spina-admin-conferences
|
@@ -554,7 +582,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
554
582
|
- !ruby/object:Gem::Version
|
555
583
|
version: '0'
|
556
584
|
requirements: []
|
557
|
-
rubygems_version: 3.
|
585
|
+
rubygems_version: 3.1.2
|
558
586
|
signing_key:
|
559
587
|
specification_version: 4
|
560
588
|
summary: Conference management plugin for Spina.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
//= require stimulus
|
2
|
-
//= require_directory ./controllers
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @external Stimulus
|
6
|
-
*/
|
7
|
-
/* global Stimulus, SelectOptionsController, PresentationAttachmentsFormController, ConferenceEventsFormController */
|
8
|
-
const application = Stimulus.Application.start()
|
9
|
-
application.register('select-options', SelectOptionsController)
|
10
|
-
application.register('presentation-attachments-form', PresentationAttachmentsFormController)
|
11
|
-
application.register('conference-events-form', ConferenceEventsFormController)
|
12
|
-
|
13
|
-
document.addEventListener('turbolinks:load', () => {
|
14
|
-
Array.from(document.getElementsByClassName('conference-datepicker')).forEach(element => {
|
15
|
-
$(element).datepicker({
|
16
|
-
dateFormat: 'yy-mm-dd',
|
17
|
-
firstDay: 1
|
18
|
-
})
|
19
|
-
})
|
20
|
-
})
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spina/admin/conferences/types/interval_type'
|
4
|
-
|
5
|
-
ActiveRecord::Type.register :interval, Spina::Admin::Conferences::IntervalType, adapter: :postgresql
|
6
|
-
|
7
|
-
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
|
8
|
-
alias_method :configure_connection_without_interval, :configure_connection
|
9
|
-
define_method :configure_connection do
|
10
|
-
configure_connection_without_interval
|
11
|
-
execute 'SET IntervalStyle = iso_8601', 'SCHEMA'
|
12
|
-
end
|
13
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
module Conferences
|
6
|
-
# This type maps between ActiveSupport::Duration and interval in PostgreSQL
|
7
|
-
class IntervalType < ActiveRecord::Type::Value
|
8
|
-
def cast(value)
|
9
|
-
case value
|
10
|
-
when ::ActiveSupport::Duration
|
11
|
-
value
|
12
|
-
when ::String
|
13
|
-
::ActiveSupport::Duration.parse(value)
|
14
|
-
when ::Integer
|
15
|
-
::ActiveSupport::Duration.build(value)
|
16
|
-
end
|
17
|
-
rescue ActiveSupport::Duration::ISO8601Parser::ParsingError
|
18
|
-
nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def serialize(value)
|
22
|
-
return unless value.class == ::ActiveSupport::Duration
|
23
|
-
|
24
|
-
value.iso8601
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|