hackathon_manager 0.13.3 → 0.13.4

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: c58a704ae8b7dbe7c60e7d346291e843a41dccddcb599f14f45fe7ffa314b7f0
4
- data.tar.gz: 724aa46d5d2daa6ede4cfca4418c52be743efa49d5104792887b0f8afe34ab20
3
+ metadata.gz: 206af0094a1b5b93d65868d634fcf363be9b1a04a47325db43fa116fcc0f1223
4
+ data.tar.gz: d64945622dbed549e05d0a6b46388c81dafd0033d41abd40e11202f5a47ce93d
5
5
  SHA512:
6
- metadata.gz: 345caf9ec10d34970e60c16df519473d97f0c3150bb975fab263b7f729255e63337d625d24cc053d7631c093cb24ea2f7b9218e3d3263403f3b3088a5feabf10
7
- data.tar.gz: 29ae8d5e018acc37da83ea02047d1d849b156cd5b98a865ab4c8cc89ad19dd10c0d92c196dff8fc53035be5e39f3cc9301c17808920407700af88baedff1069e
6
+ metadata.gz: 7562395536c84986c8173db5b09d8246beefa644a36a6385cc6c97aada6c285a04f0590d054e1d373e775e0202184bf74011c93a58789ce3a78ab426d9869bff
7
+ data.tar.gz: ce686751c30d9521434b1285304d5e48a5961ddd8c47ad10f79c44e607d46c48477eab6cf38f32d7cd17e18a4876af9b6a4d4a9b6e29f8eedba7f2a5e3fffd89
@@ -61,12 +61,16 @@ class RsvpsController < ApplicationController
61
61
  @questionnaire.acc_status_author_id = current_user.id
62
62
 
63
63
  bus_list_id = params[:questionnaire][:bus_list_id].presence
64
- is_joining_bus = !@questionnaire.bus_list_id && bus_list_id
65
64
  bus_list = bus_list_id && BusList.find(bus_list_id)
65
+ is_joining_bus = @questionnaire.bus_list != bus_list
66
66
  if is_joining_bus && bus_list.full?
67
- flash[:notice] = "Sorry, that bus is full! You may need to arrange other plans for transportation."
67
+ if @questionnaire.bus_list_id?
68
+ flash[:notice] = "Sorry, that bus is full. You are still signed up for the '#{@questionnaire.bus_list.name}' bus."
69
+ else
70
+ flash[:notice] = "Sorry, that bus is full. You may need to arrange other plans for transportation."
71
+ end
68
72
  else
69
- @questionnaire.bus_list_id = bus_list_id
73
+ @questionnaire.bus_list = bus_list
70
74
  @questionnaire.bus_captain_interest = params[:questionnaire][:bus_captain_interest]
71
75
  end
72
76
 
@@ -29,4 +29,8 @@ class BusList < ApplicationRecord
29
29
  def captains
30
30
  passengers.where(is_bus_captain: true)
31
31
  end
32
+
33
+ def name_maybe_full
34
+ full? ? "(full) #{name}" : name
35
+ end
32
36
  end
@@ -2,6 +2,7 @@ class Questionnaire < ApplicationRecord
2
2
  include ActiveModel::Dirty
3
3
 
4
4
  before_validation :consolidate_school_names
5
+ before_validation :clean_for_non_rsvp
5
6
  after_create :queue_triggered_email_create
6
7
  after_update :queue_triggered_email_update
7
8
  after_save :update_school_questionnaire_count
@@ -212,6 +213,14 @@ class Questionnaire < ApplicationRecord
212
213
 
213
214
  private
214
215
 
216
+ def clean_for_non_rsvp
217
+ if acc_status != "rsvp_confirmed"
218
+ self.bus_list_id = nil
219
+ self.is_bus_captain = false
220
+ self.bus_captain_interest = false
221
+ end
222
+ end
223
+
215
224
  def consolidate_school_names
216
225
  return if school.blank?
217
226
  duplicate = SchoolNameDuplicate.find_by(name: school.name)
@@ -52,8 +52,8 @@
52
52
  %strong You must sign up here if you want to ride.
53
53
 
54
54
  .form-inputs
55
- - bus_list_options = ([OpenStruct.new({ name: 'Not riding a sponsored bus', id: '' })] + BusList.all.to_a)
56
- = f.association :bus_list, as: :radio_buttons, collection: bus_list_options, label_method: :name, value_method: :id, label: false, wrapper_html: { class: 'radio_buttons_vertical' }
55
+ - bus_list_options = ([OpenStruct.new({ name_maybe_full: 'Not riding a sponsored bus', id: '' })] + BusList.all.to_a)
56
+ = f.association :bus_list, as: :radio_buttons, collection: bus_list_options, label_method: :name_maybe_full, value_method: :id, label: false, wrapper_html: { class: 'radio_buttons_vertical' }
57
57
  - if BusList.where(needs_bus_captain: true).any?
58
58
  = f.input :bus_captain_interest, as: :radio_buttons, collection: { " Yes!" => true, " No thank you." => false }, label: "Would you be interested in being a bus captain?"
59
59
  %p
@@ -83,8 +83,8 @@ Doorkeeper.configure do
83
83
  # `client` - the OAuth client application (see Doorkeeper::OAuth::Client)
84
84
  # `grant_type` - the grant type of the request (see Doorkeeper::OAuth)
85
85
  # `scopes` - the requested scopes (see Doorkeeper::OAuth::Scopes)
86
- #
87
- # use_refresh_token
86
+
87
+ use_refresh_token
88
88
 
89
89
  # Forbids creating/updating applications with arbitrary scopes that are
90
90
  # not in configuration, i.e. `default_scopes` or `optional_scopes`.
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.13.3'.freeze
2
+ VERSION = '0.13.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackathon_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails