tramway-event 1.12.6 → 1.12.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c5cea79e8830c3db57b2657e8df6e27d0c09f6136fc96336760c2b84f05d225
4
- data.tar.gz: 807718fa455cc0f29643e23a532b0bddec678cb2decdcd123e30ac6ffa7165f5
3
+ metadata.gz: 272ccb2552ee3c51554049f491fabc6354d27704a70855b0e936bd09eadbe8c6
4
+ data.tar.gz: f1f60419661c3117c62709533369993916b0800183a57236f79cce874a7d4d68
5
5
  SHA512:
6
- metadata.gz: 3ef4fb14eef67149617974d2c2da311be4bb6de80944be5b92d6ee95745b3a6aa0b8e4d8c573fd77152d911f6b73c800409f39eafb42f75abf5a7bcb9311db44
7
- data.tar.gz: 59660760d05f0667a9e759dad0ec9b9ea44f7e40d75477312eb466138244fce01ff292d6a0cca984d330269aff990b21ddf0c4ddf7d9fe6a9c6a25ca52cdc061
6
+ metadata.gz: 0d918788e1a99e936554c870eb33865d2aa6debb844c6e3c303cfeca81afbc48f375580df3fc72ca186de09db6404083b0820cc6d238501e7e095a007647f763
7
+ data.tar.gz: f8381014deb9219d64cd60024a2621f6a862b7abc670b8ec1ef249ba82b11a22ecc24e0c2570033e53f1e7882701c8a81245a3105f8d8a6041496d3ecf44b5d4
@@ -7,14 +7,14 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
7
7
  event = ::Tramway::Event::Event.find params[:id]
8
8
  @event = ::Tramway::Event::Events::Show::EventDecorator.decorate event
9
9
  @participant_form = ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(request.uuid, @event).new ::Tramway::Event::Participant.new
10
- @sections_as_features = @event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
11
- @sections = @event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
10
+ @sections_as_features = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
11
+ @sections = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
12
12
  @footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
13
- @events = ::Tramway::Event::Event.active.actual.map { |e| ::Tramway::Event::Events::Show::EventDecorator.decorate e }
14
- @people_as_features = @event.partakings.active.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
13
+ @events = ::Tramway::Event::Event.actual.map { |e| ::Tramway::Event::Events::Show::EventDecorator.decorate e }
14
+ @people_as_features = @event.partakings.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
15
15
  if defined?(::Tramway::Partner)
16
16
  @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
17
- hash.merge! partnership_type => (event.send(partnership_type.to_s.pluralize).active.map do |partner|
17
+ hash.merge! partnership_type => (event.send(partnership_type.to_s.pluralize).map do |partner|
18
18
  Tramway::Partner::OrganizationFeatureDecorator.decorate partner
19
19
  end)
20
20
  end
@@ -77,7 +77,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
77
77
  end
78
78
 
79
79
  def requested_participants
80
- object.participants.active.count
80
+ object.participants.count
81
81
  end
82
82
 
83
83
  def approved_participants
@@ -34,7 +34,7 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
34
34
  def partners
35
35
  if defined?(::Tramway::Partner)
36
36
  @partners ||= ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
37
- hash.merge! partnership_type => (object.send(partnership_type.to_s.pluralize).active.map do |partner|
37
+ hash.merge! partnership_type => (object.send(partnership_type.to_s.pluralize).map do |partner|
38
38
  Tramway::Partner::OrganizationFeatureDecorator.decorate partner
39
39
  end)
40
40
  end
@@ -44,7 +44,7 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
44
44
  object.event.title
45
45
  end)
46
46
  end)
47
- object.event.participant_form_fields.active.map do |field|
47
+ object.event.participant_form_fields.map do |field|
48
48
  hash = if field.options.is_a?(Hash)
49
49
  field.options
50
50
  else
@@ -20,7 +20,7 @@ class Tramway::Event::ParticipantXlsDecorator < Tramway::Export::Xls::Applicatio
20
20
  end
21
21
 
22
22
  def flexible_columns
23
- object.event.participant_form_fields.active.order(position: :asc).map(&:title).map do |key|
23
+ object.event.participant_form_fields.order(position: :asc).map(&:title).map do |key|
24
24
  { Tramway::Event::Participant.human_attribute_name(key).to_sym => -> { values&.dig(key) } }
25
25
  end
26
26
  end
@@ -3,7 +3,7 @@
3
3
  require 'securerandom'
4
4
 
5
5
  class Admin::Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
6
- properties :participation_state_event, :comment
6
+ properties :comment
7
7
  association :event
8
8
 
9
9
  def self.new(object)
@@ -11,7 +11,6 @@ class Admin::Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
11
11
  ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(
12
12
  SecureRandom.hex,
13
13
  object.event,
14
- participation_state_event: :default,
15
14
  comment: :string
16
15
  ).new object
17
16
  else
@@ -3,21 +3,21 @@
3
3
  class Tramway::Event::Action < Tramway::Core::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
- state_machine :action_state, initial: :must_be_done do
7
- state :must_be_done
6
+ aasm :action_state, column: :action_state do
7
+ state :must_be_done, initial: true
8
8
  state :done
9
9
  state :declined
10
10
 
11
11
  event :do do
12
- transition must_be_done: :done
12
+ transitions from: :must_be_done, to: :done
13
13
  end
14
14
 
15
15
  event :decline do
16
- transition must_be_done: :declined
16
+ transitions from: :must_be_done, to: :declined
17
17
  end
18
18
 
19
19
  event :return do
20
- transition %i[declined done] => :must_be_done
20
+ transitions from: %i[declined done], to: :must_be_done
21
21
  end
22
22
  end
23
23
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
3
+ class Tramway::Event::Event < ::Tramway::Core::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
 
6
6
  validate :check_dimensions
@@ -8,8 +8,6 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
8
8
  def check_dimensions
9
9
  if photo.present?
10
10
  errors.add :photo, :too_small_image if photo.width.present? && (photo.width < 1920 || photo.height < 1080)
11
- else
12
- errors.add :photo, :is_not_present
13
11
  end
14
12
  end
15
13
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
3
+ class Tramway::Event::Participant < ::Tramway::Core::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
- state_machine :participation_state, initial: :requested do
7
- state :requested
6
+ aasm :participation_state, column: :participation_state do
7
+ state :requested, initial: true
8
8
  state :prev_approved
9
9
  state :waiting
10
10
  state :rejected
@@ -13,31 +13,31 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
13
13
  state :reserved
14
14
 
15
15
  event :previous_approve do
16
- transition %i[requested without_answer waiting] => :prev_approved
16
+ transitions from: %i[requested without_answer waiting], to: :prev_approved
17
17
  end
18
18
 
19
19
  event :wait_for_decision do
20
- transition %i[requested without_answer] => :waiting
20
+ transitions from: %i[requested without_answer], to: :waiting
21
21
  end
22
22
 
23
23
  event :reserve do
24
- transition %i[requested without_answer waiting] => :reserved
24
+ transitions from: %i[requested without_answer waiting], to: :reserved
25
25
  end
26
26
 
27
27
  event :reject do
28
- transition %i[requested without_answer waiting prev_approved reserved] => :rejected
28
+ transitions from: %i[requested without_answer waiting prev_approved reserved], to: :rejected
29
29
  end
30
30
 
31
31
  event :approve do
32
- transition %i[prev_approved reserved requested] => :approved
32
+ transitions from: %i[prev_approved reserved requested], to: :approved
33
33
  end
34
34
 
35
35
  event :not_got_answer do
36
- transition requested: :without_answer
36
+ transitions from: :requested, to: :without_answer
37
37
  end
38
38
 
39
39
  event :return_to_requested do
40
- transition %i[prev_approved rejected] => :requested
40
+ transitions from: %i[prev_approved rejected], to: :requested
41
41
  end
42
42
  end
43
43
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantFormField < ::Tramway::Event::ApplicationRecord
3
+ class Tramway::Event::ParticipantFormField < ::Tramway::Core::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
6
  enumerize :field_type, in: %i[text string numeric date_picker select checkbox], default: :text
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Person < ::Tramway::Event::ApplicationRecord
3
+ class Tramway::Event::Person < ::Tramway::Core::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Section < ::Tramway::Event::ApplicationRecord
3
+ class Tramway::Event::Section < ::Tramway::Core::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
 
6
6
  belongs_to :event, class_name: 'Tramway::Event::Event'
@@ -10,7 +10,7 @@
10
10
  ::Tramway::Event::Action,
11
11
  project: :event)
12
12
  ::Tramway::Admin.set_notificable_queries new_participants: lambda { |current_user|
13
- ::Tramway::Event::Participant.active.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
13
+ ::Tramway::Event::Participant.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
14
14
  }
15
15
 
16
16
  ::Tramway::Landing.head_content = lambda do
@@ -3,33 +3,32 @@ ru:
3
3
  tramway/event/participant:
4
4
  published: Опубликованные
5
5
  hidden: Скрытые
6
- activerecord:
7
- state_machines:
8
- tramway/event/participant:
9
- participation_state:
10
- states:
11
- requested: Заявка отправлена
12
- prev_approved: Получено предварительное подтверждение
13
- waiting: Ожидание решения
14
- rejected: Заявка отклонена
15
- approved: Прибывшие
16
- without_answer: Без ответа
17
- reserved: В резерве
18
- events:
19
- previous_approve: Предварительно подтвердить
20
- wait_for_decision: Ожидать ответа
21
- reject: Отклонить
22
- approve: Прибыл(а)
23
- not_got_answer: Связаться не удалось
24
- reserve: Отправить в резерв
25
- return_to_requested: Вернуть в необработанные
26
- tramway/event/action:
27
- action_state:
28
- states:
29
- done: Сделано
30
- must_be_done: Запланировано
31
- declined: Отклонено
32
- events:
33
- do: Выполнено
34
- decline: Отклонить
35
- return: Вернуть статус
6
+ state_machines:
7
+ tramway/event/participant:
8
+ participation_state:
9
+ states:
10
+ requested: Заявка отправлена
11
+ prev_approved: Получено предварительное подтверждение
12
+ waiting: Ожидание решения
13
+ rejected: Заявка отклонена
14
+ approved: Прибывшие
15
+ without_answer: Без ответа
16
+ reserved: В резерве
17
+ events:
18
+ previous_approve: Предварительно подтвердить
19
+ wait_for_decision: Ожидать ответа
20
+ reject: Отклонить
21
+ approve: Прибыл(а)
22
+ not_got_answer: Связаться не удалось
23
+ reserve: Отправить в резерв
24
+ return_to_requested: Вернуть в необработанные
25
+ tramway/event/action:
26
+ action_state:
27
+ states:
28
+ done: Сделано
29
+ must_be_done: Запланировано
30
+ declined: Отклонено
31
+ events:
32
+ do: Выполнено
33
+ decline: Отклонить
34
+ return: Вернуть статус
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.12.6'
5
+ VERSION = '1.12.6.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.6
4
+ version: 1.12.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-28 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus
@@ -68,7 +68,6 @@ files:
68
68
  - app/jobs/tramway/event/application_job.rb
69
69
  - app/mailers/tramway/event/application_mailer.rb
70
70
  - app/models/tramway/event/action.rb
71
- - app/models/tramway/event/application_record.rb
72
71
  - app/models/tramway/event/event.rb
73
72
  - app/models/tramway/event/partaking.rb
74
73
  - app/models/tramway/event/participant.rb
@@ -136,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
135
  - !ruby/object:Gem::Version
137
136
  version: '0'
138
137
  requirements: []
139
- rubygems_version: 3.1.2
138
+ rubygems_version: 3.1.6
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: Rails engine for events
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Tramway
4
- module Event
5
- class ApplicationRecord < ::Tramway::Core::ApplicationRecord
6
- self.abstract_class = true
7
- end
8
- end
9
- end