Skip to content

Commit cdf9897

Browse files
niklas573bitboxer
authored andcommitted
add a new attribute in ticket entity for adding CWA button click count
1 parent 3b43c3c commit cdf9897

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

app/controllers/tickets_controller.rb

+1-1
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

+1-1
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

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

0 commit comments

Comments
 (0)