Best way to create a belongs_to object from a has_many
In essence, this code structure enables the creation of listings that are independent of users, offering flexibility in your application's data modeling.
alangosh replied • SolvedIn essence, this code structure enables the creation of listings that are independent of users, offering flexibility in your application's data modeling.
alangosh replied • SolvedHey Sean! Glad to hear that you found this lesson helpful. Also, thanks a bunch for sharing your tip about doing this with `has_one` relationships! I'm sure that will come in handy for folks.
cjilbert504 repliedThen for now no need..... It's working so I will let it be
John Munyi repliedSweet, I'll have to play around with it, I love a good editor! :) Did you ever mess with Summernote? http://summernote.org/examples/#hint-for-mention They support mentions out the box it looks lik...
Jacob Montgomery replied • SolvedI second @miguel's recommendation for the post from Thoughtbot. Insanely great implementation!
Jay Killeen replied • SolvedThis is great, thank you. I'm wondering, just to round out the initial Wordpress example, can you briefly describe what is needed to be done to land on lvl.me (like Wordpress.com), login, then ge...
Robert Ault replied> You can set the session[:company_id] to a default when they login, or allow them to use the site under a "Personal" account without a company. Hi folks, appreciate the commentary, it's extra ...
BKSpurgeon repliedOk, I spoke to soon. I thought I had this all wired up and the `complete` scope working. But the `!where` doesn't work any longer. I had to write the scope as such: ```` scope :complete, -> ...
shakycode repliedI forgot these existed... have you tried using `merge` / `or` to retain the `ActiveRecord::Relation` instead of returning an array? ```ruby def all_tenders self.tenders.merge(self.tenders_by_gro...
Jacob Montgomery repliedLast update: getting my associations straight! Well - like I more or less anticipated - the devil was lurking if not in the detail then in the assignment :big_smile: Going back to the drawing boa...
Walther Diechmann replied • SolvedI think there are multiple asks here. Let's tackle your wish to return c.manufacturer, c.model, c.sub_model. For only that perspective, the naive implementation is to have fields in the car tab...
Chim Kan repliedThis episode is very confusing @Chris because of the way you refactor your code every single minute...
stevenpy repliedselect_tag('entry[detail_ids]' fixes it
PDG+creative replied • SolvedImagine 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 postedOmegle Random Chat Alternative
jesusjavier repliedwould this be the same if i wanted to get a variants volume type? Would i need to add `, through: : products` on the `has_one :volume_types` in the `product_variant` model I have the following... ...
Alan Reid replied • SolvedI 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 postedhttps://dev.37signals.com/globals-callbacks-and-other-sacrileges/ There is now a blogpost about it
Patrick replied