skip to Main Content

Mysql – Rails Multiple join query

I have the below Model structure class Transaction belongs_to :company belongs_to :user end class Company belongs_to :address end class User belongs_to :address end classAddress has_many :companies has_many :users end I want to query all transactions and get both company address…

VIEW QUESTION

Postgresql – database_tasks: false not working in rails 7.1

I have 2 read replicas configured in the database.yml and I want to avoid any write operation in the Ruby on Rails application. When setting database_tasks: false the following exception was raised: /.rvm/gems/ruby-3.2.2/gems/activerecord-7.1.1/lib/active_record/railtie.rb:151:in `block (3 levels) in <class:Railtie>': undefined method…

VIEW QUESTION

Nginx – Dropping a part of the URL in Rails

I have a setup where I route all requests for /upload/* to Rails. Using the blog example, I want somedomain.com/upload/article/new to be treated as somedomain.com/article/new by Rails. I ended up with the following. routes.rb Rails.application.routes.draw do root "articles#index" scope 'upload'…

VIEW QUESTION
Back To Top
Search