This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/channels/application_cable/connection.rb | |
| module ApplicationCable | |
| class Connection < ActionCable::Connection::Base | |
| identified_by :current_user | |
| def connect | |
| set_current_user || reject_unauthorized_connection | |
| end | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create aurora_test | |
| ActiveRecord::Base.connection.execute(" | |
| CREATE TABLE aurora_test ( | |
| id SERIAL PRIMARY KEY, | |
| name VARCHAR(100), | |
| created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
| updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP | |
| ) | |
| ") |