Today I learned
  • Home
  • Github
  • Linkedin
  • Nomad Life(Travel Blog)
Sign in Subscribe

active-record

A collection of 3 posts
rails

How to fix the Index name too long error in rails migrations

Today, I was reviewing some legacy code, trying to isolate the bottlenecks and pinpoint the optimisation strategies for scaling and performance optimisations of a rails app. As the usual procedure, I wanted to check the database indexes and see if something was missing here. And my guess was in the
Mar 16, 2017 1 min read
SQL

Find out which part of your code is triggering ActiveRecord or SQL queries.

Today, I got a new pet project to play with and my job was to identify the bottlenecks and performance improvements we can make in the application. So I wanted to jump in and wanted to see what SQL queries were being triggered when someone requests data. Going through the
Mar 15, 2017 1 min read
ruby

Connecting Ruby & Active Record Without Rails

require 'active_record' require 'mysql2' # or 'pg' or 'sqlite3' # Change the following to reflect your database settings ActiveRecord::Base.establish_connection( adapter: 'mysql2', # or 'postgresql' or 'sqlite3' host: 'localhost', database: 'your_database', username: 'your_username', password: 'your_password' ) # Define your classes based on the database, as always class YourModel < ActiveRecord:
Jan 1, 2016
Page 1 of 1
Today I learned © 2023
Powered by Ghost