Skip to content

Commit 6543594

Browse files
committed
renamed event_types attribute submission_instructions to submission_template
1 parent 16d8faa commit 6543594

13 files changed

+41
-16
lines changed

app/controllers/admin/event_types_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def destroy
5050

5151
def event_type_params
5252
params.require(:event_type).permit(:title, :length, :minimum_abstract_length, :maximum_abstract_length,
53-
:submission_instructions, :color, :conference_id, :description)
53+
:submission_template, :color, :conference_id, :description)
5454
end
5555
end
5656
end

app/helpers/event_types_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def event_type_select_options(event_types = {})
1515
{ data: {
1616
min_words: type.minimum_abstract_length,
1717
max_words: type.maximum_abstract_length,
18-
instructions: type.submission_instructions
18+
instructions: type.submission_template
1919
} }
2020
]
2121
end

app/models/event_type.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# length :integer default(30)
1111
# maximum_abstract_length :integer default(500)
1212
# minimum_abstract_length :integer default(0)
13-
# submission_instructions :text
13+
# submission_template :text
1414
# title :string not null
1515
# created_at :datetime
1616
# updated_at :datetime

app/views/admin/event_types/_form.html.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
%abbr{title: 'This field is required'} *
2525
= f.number_field :maximum_abstract_length, size: 3, required: true, class: 'form-control'
2626
.form-group
27-
= f.label :submission_instructions, 'Submission Template'
28-
= f.text_area :submission_instructions, rows: 5, data: { provide: 'markdown' }
27+
= f.label :submission_template
28+
= f.text_area :submission_template, rows: 5, data: { provide: 'markdown' }
2929
.help-block= markdown_hint
3030
.form-group
3131
= f.label :color

app/views/admin/event_types/index.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
%td
2525
= markdown(event_type.description)
2626
%td
27-
= markdown(event_type.submission_instructions)
27+
= markdown(event_type.submission_template)
2828
%td
2929
= event_type.length
3030
Minutes

app/views/proposals/_submission_type_content_form.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
3434
- program.event_types.each do |event_type|
3535
.help-block.select-help-text.event_event_type_id.collapse{ id: "#{dom_id(event_type)}-instructions" }
36-
- if event_type.submission_instructions.blank?
36+
- if event_type.submission_template.blank?
3737
%p
3838
Use this space to include any additional inforrmation that is helpful in reviewing your
3939
submission.
@@ -43,7 +43,7 @@
4343
committee review your submission with all the details they need.
4444
.panel.panel-primary
4545
.panel-heading= "#{event_type.name} Template"
46-
.panel-body= markdown(event_type.submission_instructions)
46+
.panel-body= markdown(event_type.submission_template)
4747
.panel-footer
4848
%button.btn.btn-warning.btn-xs.js-resetSubmissionText{ type: 'button',
4949
data: { confirm: 'Do you really want to reset your submission text to the provided template?' } }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class RenameSubmissionInstructionsToSubmissionTemplate < ActiveRecord::Migration[7.0]
2+
def change
3+
rename_column :event_types, :submission_instructions, :submission_template
4+
end
5+
end

db/schema.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.0].define(version: 2023_03_09_012731) do
13+
ActiveRecord::Schema[7.0].define(version: 2024_02_26_175634) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "pg_stat_statements"
1616
enable_extension "plpgsql"
@@ -223,7 +223,7 @@
223223
t.integer "program_id"
224224
t.datetime "created_at", precision: nil
225225
t.datetime "updated_at", precision: nil
226-
t.text "submission_instructions"
226+
t.text "submission_template"
227227
end
228228

229229
create_table "event_users", force: :cascade do |t|

spec/factories/event_types.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# length :integer default(30)
1111
# maximum_abstract_length :integer default(500)
1212
# minimum_abstract_length :integer default(0)
13-
# submission_instructions :text
13+
# submission_template :text
1414
# title :string not null
1515
# created_at :datetime
1616
# updated_at :datetime
@@ -24,7 +24,7 @@
2424
description { 'Example Event Description\nThis event type is an example.' }
2525
minimum_abstract_length { 0 }
2626
maximum_abstract_length { 500 }
27-
submission_instructions { 'Example Event Instructions _with_ **markdown**' }
27+
submission_template { 'Example Event Instructions _with_ **markdown**' }
2828
color { '#ffffff' }
2929
program
3030
end

spec/features/event_types_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fill_in 'event_type_title', with: 'Party'
2424
fill_in 'event_type_length', with: '240'
2525
fill_in 'event_type_description', with: '**Description**'
26-
fill_in 'event_type_submission_instructions', with: '**Instructions**'
26+
fill_in 'event_type_submission_template', with: '**Instructions**'
2727
fill_in 'event_type_minimum_abstract_length', with: '0'
2828
fill_in 'event_type_maximum_abstract_length', with: '13042'
2929
page.find('#event_type_color').set('#e4e4e4')

spec/features/proposals_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
it 'can reset to text template', feature: true, js: true do
223223
event_type = conference.program.event_types[-1]
224224
event_type.description = 'Example event description'
225-
event_type.submission_instructions = '## Fill Me In!'
225+
event_type.submission_template = '## Fill Me In!'
226226
event_type.save!
227227

228228
sign_in participant
@@ -237,7 +237,7 @@
237237
# click_button 'Reset Submission to Template'
238238
# end
239239

240-
# expect(page.find('#event_submission_text').value).to eq(event_type.submission_instructions)
240+
# expect(page.find('#event_submission_text').value).to eq(event_type.submission_template)
241241
end
242242
end
243243

spec/models/event_type_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# length :integer default(30)
1111
# maximum_abstract_length :integer default(500)
1212
# minimum_abstract_length :integer default(0)
13-
# submission_instructions :text
13+
# submission_template :text
1414
# title :string not null
1515
# created_at :datetime
1616
# updated_at :datetime

spec/serializers/event_schedule_serializer_spec.rb

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: event_schedules
6+
#
7+
# id :bigint not null, primary key
8+
# enabled :boolean default(TRUE)
9+
# start_time :datetime
10+
# created_at :datetime not null
11+
# updated_at :datetime not null
12+
# event_id :integer
13+
# room_id :integer
14+
# schedule_id :integer
15+
#
16+
# Indexes
17+
#
18+
# index_event_schedules_on_event_id (event_id)
19+
# index_event_schedules_on_event_id_and_schedule_id (event_id,schedule_id) UNIQUE
20+
# index_event_schedules_on_room_id (room_id)
21+
# index_event_schedules_on_schedule_id (schedule_id)
22+
#
323
require 'spec_helper'
424

525
describe EventScheduleSerializer, type: :serializer do

0 commit comments

Comments
 (0)