tramway-event 2.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 015ee29d79339473ab21a7599accf8bc1b6069dc2857b2c27e2f043009ffe0d3
4
- data.tar.gz: 14bc25abb9f1b8ad28c934950217fb9b11499f761fa6ea941e1bddc628015958
3
+ metadata.gz: 1d2330e183117efbb0ead5998a63fb5ba46ca89a9a4b9ec18b4248c28adcff15
4
+ data.tar.gz: f2d8ea1db0b4a1a83d7d396f6d1c4a26554408d287bb3690b309d74e08c617e2
5
5
  SHA512:
6
- metadata.gz: 6470ed1ac3acb351551206cef82ad9629f4216a679af39ee1c0a0ac423cc2dcb56d095702b56917aacc9a160a2669a60c95a6f996ef8aa561a8df21df021638c
7
- data.tar.gz: 4511da3a712ebb85953d3c807c91bfead1bc81a3c9f046e462a8fe4814fe5b6a76206715e48f6483d6ca6ab713f159beb48abfb9f61600132bd55ec688109743
6
+ metadata.gz: 298c9914f04412fbc04cb5f004cc196f927fc5e07a964b88c4d254d9d6380ad52bb8b5da18e620b49298b00c8b20870e7ee7623632217a525f27a602b2fcc04a
7
+ data.tar.gz: bc400150dbefb13d06132aba26055e06e16a38f3b4d1c45cf791f3d566fab8e7b9ffc72863e339536e1bdd73de1154e6e5de5a8a8b50d089eef366eac8604726
@@ -3,6 +3,10 @@
3
3
  class Tramway::Event::Participant < ::Tramway::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
+ def self.ransackable_attributes(auth_object = nil)
7
+ ["event_id"]
8
+ end
9
+
6
10
  aasm :participation_state, column: :participation_state do
7
11
  state :requested, initial: true
8
12
  state :prev_approved
@@ -1,18 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::Tramway.set_available_models(::Tramway::Event::Event,
4
- ::Tramway::Event::ParticipantFormField,
5
- ::Tramway::Event::Participant,
6
- ::Tramway::Event::Section,
7
- ::Tramway::Event::Person,
8
- ::Tramway::Event::Partaking,
9
- ::Tramway::Event::Place,
10
- ::Tramway::Event::Action,
11
- project: :event)
12
- ::Tramway.set_notificable_queries new_participants: lambda { |current_user|
13
- ::Tramway::Event::Participant.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
14
- }
3
+ Rails.application.config.after_initialize do
4
+ Tramway.set_available_models(
5
+ [
6
+ Tramway::Event::Event,
7
+ Tramway::Event::ParticipantFormField,
8
+ Tramway::Event::Participant,
9
+ Tramway::Event::Section,
10
+ Tramway::Event::Person,
11
+ Tramway::Event::Partaking,
12
+ Tramway::Event::Place,
13
+ Tramway::Event::Action
14
+ ],
15
+ project: :event
16
+ )
17
+ Tramway.set_notificable_queries new_participants: lambda { |current_user|
18
+ Tramway::Event::Participant.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
19
+ }
15
20
 
16
- ::Tramway::Landing.head_content = lambda do
17
- javascript_include_tag 'tramway/event/application'
21
+ Tramway::Landing.head_content = lambda do
22
+ javascript_include_tag 'tramway/event/application'
23
+ end
18
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '2.0'
5
+ VERSION = '2.0.1'
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: '2.0'
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-16 00:00:00.000000000 Z
11
+ date: 2023-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tramway