int23

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in NoMethodError in Contacts#edit

As @jack mentioned, it's probably better using resources.  This should fix things.  If it doesn't please post your error with any potential stacktrace and the community will have a look.
Without more information and background on what you're doing it's hard to say.  A google search turns up a ton of SO articles on this, some related to testing, some not.  Can you give more detail?

Posted in Build Multitenancy App in a different way

So this gets a little bit tricky since you're essentially wanting an organizational feature with split databases.  I'm not sure how to pull this off with the separate databases as I've always used PG split schemas agnostic of the subdomain.

But if you're ok with keeping all tenant/user data in single database you could go with scopes and a mix of authorization (roll your own or choose pundit or something like that).  I know that Rails 6 will support multi-databases baked into AR, but I don't think we're there yet, but someone else may be able to chime in.

If you could bullet point your specs, I might be able to get a clearer picture and offer a bit more insight.

Posted in Dependency Inversion Principle Discussion

This is a great episode.  Everyone should learn SOLID

Posted in How to start and stop ngrok with Thin server?

Agreed on using foreman.  It's the easiest way, unless you want to setup some bash script as your entry point that launches both.  In this case foreman is great as the other posters have mentioned.

Posted in Need some help with an Active Record Query

Can you post your error?  

Typically an example AR query that does what you want would be:

Stores.where(user_id: current_user.id).first If you aren't using devise or a current_user method, you can simply pass in the `id` against `user_id` from a param or some other method.  Hope this helps.
logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.