I have a has_many_through association where Users have many Projects through ProjectUsers. Rails has some magic that allows updating this relationship ...
I have a has_many_through association where Users have many Projects through ProjectUsers. Rails has some magic that allows updating this relationship ...
This question relates to a Rails API-only application using Searchkick (with Opensearch) and PostgreSQL. Some results are taking a long time to render ...
On a Rails (5.2) app with PostgreSQL I have 2 tables: Item and ItemPrice where an item has many item_prices. Table Item id na ...
My main idea is to count the number of ActiveRecord queries for every API hit in rails. I was looking into ActiveSupport instrumentation API. And it s ...
I work on a booking application, where each Home can have several Phone. I would like to limit the number of Phone by Home to 3, and display a nice er ...
I am getting this error when I try to add a new case Recently I clone my app from heroku and I pull all the database from there then when I added a ...
I'm trying to figgure out to upate bulk of records with upate_all helper after while dynamically update columns value i.e User.update_all(code: Diges ...
The following SQL query works fine: The saved field is in JSON datatype. However, when I try to use activerecord query for Gridview widget's search ...
I have a legacy codebase which I need to upgrade to ActiveRecord 6. It does not use Rails. I need to be able to connect to multiple databases. In my ...
Given the model: Member -> belongs_to :category Category -> has_many :members I would like to know for every category whether or not it ...
I have two tables (A and B) and a relatively complicated Active::Record::Relation that selects from a join of these two tables. The query executes cor ...
I have a query I have made that works well My 'team' class is simply The team class has a one to many relationship with the CoachFee class. The ...
Note - I have never stood up a ruby app like this from the ground up and I am also very unfamiliar with Azure. I am trying to connect to an existing ...
Say I have a table called books with a column in it called keyword. Say I also have a string called words. I want to select all records from books wh ...
I have some code that magically stopped working (no code was pushed)! I have a function that gets called on a nightly basis to charge some subscripti ...
. Answers to this question are eligible for a +50 reputation bounty. Ti ...
I would like to create an association to another a model when creating a record. The models use the has_many through association. Models Recipe ...
I am curious why these are producing different outputs. The desired output is an array of ActiveRecord records. When using an in-line block, it appea ...
I have a custom validator that I want to apply to several attributes in the same model right now I the following the works just fine: But when I t ...
I have a controller method that currently returns a random record. Controller The model that it queries has a has_many through association to anot ...