enter image description here Upgraded rails from 6.0.3 to 6.1.5 but having issues with query methods like eager_load and references. class Note < Application
I have a simple has_one relationship class User < ApplicationRecord has_one :detail has_many :courses end class Detail < ApplicationRecord belongs_
The difference between after_create, after_save and after_commit in Rails is that: after_save is invoked when an object is created and updated after_commit is
I am creating a ActiveRecord transaction this way ActiveRecord::Base.transaction do MyModel.create!(name: "value") OtherModel.create!(name: "value") end
I already have a working solution, but I would really like to know why this doesn't work: ratings = Model.select(:rating).uniq ratings.each { |r| puts r.rating
Rails 3.2 app running on Heroku with Postgres. I added an index add_index :lines, :event_id Events have_many Lines. There are about about 2 million Lines and
I'm working on the project where we are using :sql schema format for the Active Record dumper (to support more complex logic like triggers). We have a lot of