Skip to content

Commit 06e3929

Browse files
committed
add a new attribute in ticket entity for adding CWA button click count
1 parent 104e6ef commit 06e3929

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

app/controllers/tickets_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def risk_feed
3131
private
3232

3333
def ticket_params
34-
params.require(:ticket).permit(:id, :area_id, :entered_at, :left_at, :encrypted_data, :public_key, :accepted_privacy_policy)
34+
params.require(:ticket).permit(:id, :area_id, :entered_at, :left_at, :cwa_checked_in, :encrypted_data, :public_key, :accepted_privacy_policy)
3535
end
3636
end

app/models/ticket.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Ticket < ApplicationRecord
55
has_paper_trail on: [:update], only: [:encrypted_data]
66

77
AUTO_CHECKOUT_AFTER = 4.hours
8-
EXPOSED_ATTRIBUTES = %i[id entered_at left_at area_id company_name company_address company_location_type company_cwa_link_enabled company_auto_checkout_time area_name]
8+
EXPOSED_ATTRIBUTES = %i[id entered_at left_at area_id company_name cwa_checked_in company_address company_location_type company_cwa_link_enabled company_auto_checkout_time area_name]
99

1010
enum status: { neutral: 0, at_risk: 2 }
1111

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddCwaTrackingToTickets < ActiveRecord::Migration[6.1]
2+
def change
3+
add_column :tickets, :cwa_checked_in, :integer
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 1 deletion
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.define(version: 2021_05_17_071658) do
13+
ActiveRecord::Schema.define(version: 2021_06_14_144014) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "pgcrypto"
@@ -147,6 +147,7 @@
147147
t.string "public_key"
148148
t.uuid "area_id"
149149
t.boolean "accepted_privacy_policy"
150+
t.integer "cwa_checked_in"
150151
t.index ["area_id"], name: "index_tickets_on_area_id"
151152
end
152153

0 commit comments

Comments
 (0)