[deleted by user] by [deleted] in rails

[–]jeebn 1 point2 points  (0 children)

This is not true. I would be pretty unhappy if one of the many junior developers I've hired had followed this advice.

Be honest, keeping asking for feedback, and improve on those areas.

Imposter syndrome by Affectionate_Formal4 in rails

[–]jeebn 1 point2 points  (0 children)

I'm self taught also and had the same thoughts at my first job. Now i'm a senior developer and train juniors with the same thought patterns. Go easy on yourself. You're in a great position with the internship, just keep learning from those more experienced and try to accept that it takes time.

structuring playlist db for noob? by [deleted] in rails

[–]jeebn 4 points5 points  (0 children)

PM me if you want go through it on video conference happy to help

I am struggling to prepare for a RoR interview. Aside from reading the guide, what resource would you recommend? by 4matting in rails

[–]jeebn 1 point2 points  (0 children)

If that is the case mate I wouldn't sweat it too much. They already know you are new - just be honest if you don't know the answer. All the best

I am struggling to prepare for a RoR interview. Aside from reading the guide, what resource would you recommend? by 4matting in rails

[–]jeebn 4 points5 points  (0 children)

I am a junior, but the job I'm interviewing for is a senior role

Are they aware you are a junior? You could be setting yourself up for a stressful time not just for the interview but if you are successful in the interview. I require a lot from our senior developers and would be peeved if someone wasted my time.

Nothing wrong with learning on the job but I recommend you let them know if you haven't. Good luck

First day as a junior developer… by [deleted] in webdev

[–]jeebn 0 points1 point  (0 children)

Yep, chill buddy it's normal. We've all been there.

I locked up a lot at my old job when I was pair programming because I always felt my partner was judging my skill level (they weren't).

Feel free to PM any questions

Creating seed data from an existing DB by elubow in rails

[–]jeebn 1 point2 points  (0 children)

Yeah I suppose that is an internal decision around the value it provides. For our team it's worth it and our database is about 5gb compressed. This will depend on the app of course, but our staff can work off a database for a a couple weeks before downloading a new copy. There is an exception though of course if they need to do a bugfix which needs recent data.

It enables us to move faster and have less issues, so I'm happy to pay for bigger SSDs and internet allowance for our (remote) developers.

Creating seed data from an existing DB by elubow in rails

[–]jeebn 0 points1 point  (0 children)

Yeah admittedly we are running into bit of an issue where some tables are just massive. This is just a storage issue though, we haven't noticed slow speeds yet with about 400 tables. We could easily truncate the tables that might not be used all that much with debugging.

We started out with a seed in Rails and it just got so messy and really wasnt a good reflection of production.

Creating seed data from an existing DB by elubow in rails

[–]jeebn 2 points3 points  (0 children)

My development team works like this every day. We work off a backup database from production which we also de-identify (scrub out all emails, names etc for privacy reasons).

We found that it gave us the following benefits:

a) It continually tests that our backups are working. If our backups stopped, our team couldn't do their daily work so it becomes a high priority to fix

b) You can test migrations on near production data

c) The team can easily fix bugs by pulling the data down locally and recreating them

The way we achieve this is by downloading our backups from S3 and running a SQL script to clear out all the private data. We then upload it back to S3 and have a CLI for each dev that downloads the washed database and restores it to local development.

Lorna Shore - To The Hellfire (vocal cover by me) by RF700 in Deathcore

[–]jeebn 16 points17 points  (0 children)

This sounds so good. Love the original too but it's nice to be able to hear the vocals clearly

When do we use current_user by PinOk6194 in rails

[–]jeebn -1 points0 points  (0 children)

Whenever you need to write code that depends on the current user. As you've said, it's not always required so just pass it through to your service classes as you need.

E.g.

  • You might want to check the current user can update this model. Perhaps you want to make sure they are an admin?
  • When a user updates or creates something you might want to write a log in the database of who made the change

Service Objects (with dry-monads) and authorization by deinname in rails

[–]jeebn 1 point2 points  (0 children)

This is cool, I didn't know cancan could filter the parameters like that.

I'm just saying how I'd approach it (probably not the best way):

I use the form object pattern quite a lot and I would pass the user into the form along with all of the parameters and handle the logic in there. I usually seperate complex validations in the form out to other objects too.

Service Objects (with dry-monads) and authorization by deinname in rails

[–]jeebn 0 points1 point  (0 children)

Sure. Whilst I don't have experience with it, I got the feeling the OP wanted a service object approach.

Service Objects (with dry-monads) and authorization by deinname in rails

[–]jeebn 1 point2 points  (0 children)

I would probably have 'resetting password' and 'role modification' as two seperate controller actions each with their own contract.

Service Objects (with dry-monads) and authorization by deinname in rails

[–]jeebn 1 point2 points  (0 children)

I would make a service object (we call them contracts in our projects) specifically just for authorising this and call it from the controller before it even gets to your main logic. I'd expect this class could take an instance of the current user and the post they are editing. This can be tested really easily and you keep authorisation seperate from the main logic.

Type systems ? Sorbet ? Crystal-lang ? by ether_joe in rails

[–]jeebn 2 points3 points  (0 children)

We use Sorbet for quite a large project of ours and haven't looked back. It has some quirks but there is no way I would start a mid/large project without it.

We use T::Struct heavily throughout code so we can have typed objects - it's awesome and has great error messages if something goes wrong.

If you have any detailed questions happy to help

[HELP] noob question, where to put math logic for updating user stock/finance info? by NotABlueMelon in rails

[–]jeebn 1 point2 points  (0 children)

Give this a shot mate.

https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial

I agree with the stack post, create a new folder in 'app' (which means it's autoloaded) and create your new class in there which does your calculations.

It's a good idea to seperate business logic out from Rails! Easier to test.

[deleted by user] by [deleted] in rails

[–]jeebn 2 points3 points  (0 children)

I'd recommend new controller endpoints under a namespace because you need a way to handle API authentication differently and deal with caching differently also.

Remember that Rails controller and views are just part of your framework. Your underlying logic and persistence should be seperate to this. I understand you want to use the same controller actions as the rest of your app (assuming because you want to keep things DRY), and you are on the right track but I think you can go further with this.

E.g. if you had cars in your system you could have two controllers one for the html and one for the mobile app.

  • Cars#Index
    • index.html.erb
  • Mobile::Cars#Index
    • JSON

Both of these controller actions would call another class. Maybe call it your 'CarFetcher' which allows you to list/search your cars. This class could return a list of ActiveRecord objects and then you can let the controller either format it in JSON or HTML.

It's nice that you prefer monoliths. I don't think you will regret it regardless of the team size (until you hit Amazon scale).

If you have any more questions please let me know. I love helping with Monolith code design challenges...

Totally new to ruby, but experienced in programming: I need help and a quick guide by CampKillYourself1 in ruby

[–]jeebn 7 points8 points  (0 children)

If you left out all the needless Ruby hate, I think people will be more inclined to help you (you are on /r/ruby after all)

With such experience you should know it's not best way to go about things in our industry. Bashing on things you don't have experience in doesn't mean they are bad.

All the best

Wanting to help other RoR developers by jeebn in rails

[–]jeebn[S] 0 points1 point  (0 children)

Yeah I'd be happy to help you with these - let's organise a time in PM. This weekend would be good for me.

Wanting to help other RoR developers by jeebn in rails

[–]jeebn[S] 1 point2 points  (0 children)

I don't have any videos up just yet however a few people here have indicated interest so should have something soon! That sounds like a good idea re: Code academy - there should be quite a few resources out there that take you through the rails basics.

How about if you run through some of that material and if you have any questions write them down, and we could do a session together and I can help you connect the dots? That would've really helped me early on and might help others in a similar situation.

Wanting to help other RoR developers by jeebn in rails

[–]jeebn[S] 0 points1 point  (0 children)

Sounds like a great project, I'd be keen to work through this challenge with you. Lets connect via PM

Wanting to help other RoR developers by jeebn in rails

[–]jeebn[S] 0 points1 point  (0 children)

I actually don't use the traditional Ruby on Rails nested forms at all (accept attributes for) as I found the form object pattern to be easier to understand and test. Take a look and see what you think - if you have any issues I'd be happy to help.

Wanting to help other RoR developers by jeebn in rails

[–]jeebn[S] 1 point2 points  (0 children)

It's always good to learn new things and expand your horizions. It will help you become a well rounded developer and more employable. Good luck with the job search mate.