Skip to content

Instantly share code, notes, and snippets.

View baala3's full-sized avatar
🎯
Focusing

bala baala3

🎯
Focusing
View GitHub Profile
@baala3
baala3 / a.connection.rb
Last active November 25, 2024 02:59
rails v8 new authentication generator files
# 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
@baala3
baala3 / aurora_migration_test.rb
Last active May 22, 2024 03:11
aurura migration test cases
# 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
)
")