Skip to content

Commit

Permalink
fix: protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
takaishi committed Nov 20, 2024
1 parent 6a096a2 commit 9486d64
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/qr_code_for_stamp_rally.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ def url
Rails.application.routes.url_helpers.new_stamp_rally_check_in_url(
event: event.abbr,
params: { stamp_rally_check_point_id: stamp_rally_check_point.id },
protocol: protocol,
host: Rails.application.default_url_options[:host]
)
end

def protocol
Rails.env.production? ? 'https' : 'http'
end

def url_qrcode_image
Base64.strict_encode64(RQRCode::QRCode.new([{ data: url, mode: :byte_8bit }]).as_png(size: 300).to_s)
end
Expand Down

0 comments on commit 9486d64

Please sign in to comment.