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 ...
I have a Modal "ProjectCase" and I'm trying to link the Model "Services" to it. My database structure is like this: ProjectCases id t ...
I have a set that has a list of group and each group has a list of attributes like this I need to save the set with groups and attributes, this is ...
I have 2 tables, Item and ItemBelonging. I'm trying to create tree relationships between items. For every descendant of an item I create a item_belong ...
Problem: I have a model Exercise, this model can have exercises that are variations of each other. So a self join table I thought. Like a join table ...
I am current working on a project that includes models like (projects and users). Both of these models has many-to-many association which is done thro ...
I have the following models: class Physician < ApplicationRecord has_many :appointments has_many :patients, through: :appointments end class ...
I have the following classes: class Post < ApplicationRecord ...
I'm pretty new to Ruby and having some trouble with how I would approach decrementing info in a db using a has_many :through table. My tables are food ...
I Have I want to use hasManyTrough to get files data from worker, I defined In worker but It expects document_id, how can I use ir for polymirhi ...
I have faced with a problem with joining the tables with hasMany way The tables I have: brands:{ id - integer; name - string; image- string; } prod ...
I have 3 Models. Archive -> ArchiveJoin <- Contacts ArchiveJoin is a polymorphic join table. I want to be able to associate Archive and contact ...
I've been looking around for a fix but couldn't find it. The situation: Resources are connected to an Event, multiple resources can be connected to ...
in my models, I have those relations: Category -> Subcategories : hasMany Subcategories -> Category : belongsTo Subcategory -> Produc ...
Ok so I have a scenario where i need to get all active jobs allocated to a particular user. I have the following tables (just the columns of any note ...
I have 4 models: User, Photo, Article and Comment. Comment model is polymorphic and it is used for Photo and Article. Structure is: In User.php I ...
I have a model which has a lot of associations. What I need to do is to check whether one of those associations is not present or all of them are set ...
I have three models that have a has_many_through relationship like this: I need to write a query using sql language to get all the tags that be ...
I’m using Rails 6.0.4.4 with Ruby 2.5.7. How do I construct a has-many-through association? I have these models with accompanying associations But ...
I have 3 tables Company->ManyToMany->Activity->BelongsTo->chamber i need to use HasmanyDeep to find all chambers related to specific com ...