Skip to content

Commit

Permalink
Merge pull request #29 from interflux-electronics/feature/event-website
Browse files Browse the repository at this point in the history
Add migration and serializers for Event.website
  • Loading branch information
janwerkhoven authored Apr 19, 2024
2 parents 71902db + ac82717 commit e6dbfaa
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/controllers/v1/admin/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def creatable_attributes
confirmation_email_subject
confirmation_email_body
confirmation_email_bcc
website
]
end

Expand Down
1 change: 1 addition & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# has_registration_form :boolean
# name :string
# start_date :string
# website :string
# created_at :datetime not null
# updated_at :datetime not null
# country_id :string
Expand Down
3 changes: 2 additions & 1 deletion app/serializers/v1/admin/event_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class EventSerializer < ApplicationSerializer
:ask_company,
:confirmation_email_subject,
:confirmation_email_body,
:confirmation_email_bcc
:confirmation_email_bcc,
:website

belongs_to :country

Expand Down
3 changes: 2 additions & 1 deletion app/serializers/v1/public/event_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class EventSerializer < ApplicationSerializer
:ask_first_name,
:ask_last_name,
:ask_role,
:ask_company
:ask_company,
:website

belongs_to :country
end
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240419091308_add_website_to_event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddWebsiteToEvent < ActiveRecord::Migration[6.1]
def change
add_column :events, :website, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_04_18_113914) do
ActiveRecord::Schema.define(version: 2024_04_19_091308) do

# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
Expand Down Expand Up @@ -275,6 +275,7 @@
t.string "confirmation_email_subject", default: "See you soon at {event_name}!"
t.string "confirmation_email_body", default: "Hello {first_name} {last_name}, We look forward seeing you at {event_name} on {event_date} in {event_location}. Best regards, The Interflux Electronics team"
t.string "confirmation_email_bcc", default: "[email protected], [email protected]"
t.string "website"
end

create_table "features", primary_key: "slug", id: :string, force: :cascade do |t|
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# has_registration_form :boolean
# name :string
# start_date :string
# website :string
# created_at :datetime not null
# updated_at :datetime not null
# country_id :string
Expand Down

0 comments on commit e6dbfaa

Please sign in to comment.