Search Results for "a-has_one-through-association-issue"
Lessons
Forum Threads

Best way to create a belongs_to object from a has_many
19
General
Sorry for the vague title but I cant think of a better explanation! Let's say I have a list of Users and an admin could click a button/link that would create a site for them from the existing ...
alangosh replied
Solved

Dynamic Nested Forms with Turbo Discussion
44
General
Great demo of an awesome new ability. Thanks!
cjilbert504 replied

How do I implement a model association that when changed older records are not affected
6
General
Here are my models (User , Project and Task) A user has many projects , a project has many users , A project has many tasks and a tasks belongs to a project , a user has many tasks and a task belo...
JM replied

Pull data from another table in a lookup
53
Rails
Hi all,
I am looking up a list of articles, depending on the brand ID's - `@articles = Article.where(brand_id: brand_ids)` what i would like to know is there a way to retrieve the brand name in thi...
Jacob Montgomery replied
Solved

How do I Export a CSV file where it includes all the nested attributes?
16
Rails
Greetings:
I would like to export a CSV file where it includes all the nested attributes. I have an invoice model and a product model. Each invoice has many products. I am able to export to CSV fo...
Solved

How do I search Action Text with Ransack?
9
Rails
I have set up a basic search using Ransack but I don't understand how to get it to search Action Text. This is how it is implimented in the search_form_for:
f.search_field :title_or_rcontent_or_c...
Jay Killeen replied
Solved

Handling Subdomains and Multitenancy From Scratch Discussion
55
General
This is my favorite episode thus far. The expansion on top of Rails is so intuitive, never thought how useful separating accounts from users would be.Hopefully there's a simple answer to this. When...
Robert Ault replied

Structure Guidance - Multi Tenancy Authentication / Authorization
19
Rails
I while back I was playing around building an app where you had multiple tenants (Company Model) and a single login (User Model). I then created roles (Role Model) to link the users to the tenants....
BKSpurgeon replied

Idea for TimeClock Need Advice
27
General
I'm wanting to integrate Time Clock functionality into an existing Rails 3.2.21 app. I think I have an idea of how to do this, but I need some advice on the how to handle different scenarios.
So ...
shakycode replied

Should scopes be seperated out to allow chaining or be specific to the what you are trying to do?
4
Rails
I am trying to write an internal tender application and am having trouble figuring out the best approach for writing a scope.
I have the following models
```
class Tender < ApplicationRecord
...
Jacob Montgomery replied

How do I #create with a double delegated_type and has_many :through
5
Rails
I have this marvelous complicated DB design that goes along these lines: events ( like calls, tasks, and meetings ) can have a number of assignees (Participants, and Assets) - like a Team Meeting c...
Walther Diechmann replied
Solved

Rails Association Question
1
Rails
Hello
I have an app where I have a list of Cars. I have a form above that can filter them based on different attributes. I wish to add filtering based on their model and sub-models.
Each car alre...
Chim Kan replied

Password Sharing Roles & Permissions Discussion
4
General
this on was confusing to me indeed. i was not able to follow, why we do what we do in each refactoring.
thanks, i will rewatch this
Alex H. replied

Having Problems with has_one association driving me crazy
1
Rails
Im having a problem
I have an Entry which can have many Detail through EntryDetail
https://gist.github.com/staycreativedesign/568f07938591d2a8a844d3857c4aac4a
The EntryDetails arent being saved ...
PDG+creative replied
Solved

Trying to emulate `belongs_to trough` using `has_one trough` but having problems
0
Rails
Imagine a travel website where you have `HotelOwner`s and `Tourist`s. When they start a conversation, the app creates a join model named `Conversation` using has_many through. It's a classic many t...
TL posted

Trying to emulate `belongs_to trough` using `has_one trough` but having problems?.
5
General
Hello,
Imagine a travel website where you have HotelOwners and Tourists. When they start a conversation, the app creates a join model named Conversation using has_many through. It's a classic many...
jesusjavier replied

Was wondering id there is a way i can simply this ...
6
Rails
I was wondering if there is any way I can simplify this code, Ideally, I don't want to be looking up brands that are associated with the user, i want to do it on hit.
```
#Gets the ID associated t...
Alan Reid replied
Solved

Is it possible to make multiple belongs_to or has_one association?
0
Rails
I have a table Operations with two columns referenced to Accounts. One column is called **debit_id** and other **credit_id**. Model looks like
```
belongs_to :debit, class_name: :Account, opt...
Kolbasoid posted

Recording pattern (Basecamp 3)
7
Rails
Has anyone tried to unravel the recording pattern used in Basecamp 3 ?
You can find breadcrumbs in the "On Writing Software Well" video series (https://www.youtube.com/playlist?list=PL9wALaIpe0Py6...
Patrick replied