and_ser Profile Banner
maverickmeerkat Profile
maverickmeerkat

@and_ser

Followers
80
Following
17K
Statuses
102

Ruby On Rails developer with PHP background

Web
Joined October 2008
Don't wanna be here? Send us removal request.
@and_ser
maverickmeerkat
2 days
@pt_ivojesus @MorriceGavin No. Model can be PORO 🤷‍♂️
1
0
0
@and_ser
maverickmeerkat
3 days
@MorriceGavin @juliknl @pt_ivojesus Yep. That’s why service object becomes to rescue. It has certain state, dependencies, logic, covers certain flow. So it prevents dev from making chaos 👌 Dev can use DDD to create small parts of logics in domains but to connect them into real action - it’s a job for SO only.
0
0
0
@and_ser
maverickmeerkat
3 days
@MorriceGavin @pt_ivojesus First approach, Payment - it’s just singleton with bunch of methods? Bad idea tbh. It’s not scalable. Second approach - it’s same like CreatePaymentService that operates all needed models, passed dependencies & other services 🤷‍♂️ All knowledge & state about action in one place.
0
0
0
@and_ser
maverickmeerkat
3 days
@MorriceGavin @pt_ivojesus How you will connect different models with different contexts into one workflow? As example. I have a flow: get an advisory lock, create payment in PG, send requests to third party about this payment, send event to rabbitmq to notify other related services, free lock.
1
0
1
@and_ser
maverickmeerkat
3 days
@hopsoft @MorriceGavin Wrong. SO is a glue between different logics. SO is a way to control complex things inside one class in one place instead of spreading complexity between different domains. Also SO are perfectly testable & providing explicit approach of implementation.
0
0
0
@and_ser
maverickmeerkat
3 days
@pt_ivojesus @MorriceGavin Wrong. People that learn a lot understand that most stable implementation of domains actions is an SO, cause it control certain flow of business logic. People that don’t understand what are they doing - hates SO & trying to overload models with different actions 🤦‍♂️
2
0
0
@and_ser
maverickmeerkat
4 days
@fatkodima Will be cool to have a choice between jobs runner. We use Resque, for example.
0
0
0
@and_ser
maverickmeerkat
4 days
@fatkodima @lucianghinda Looks cool. We use native rails migrations, strong_migrations gem & data-migrate gem. Also our data migrations calls resque worker to do heavy data operations. Looks like yours doing similar things.
0
0
0
@and_ser
maverickmeerkat
4 days
@jorgemanru @nateberkopec Looks stupid. You’re not provided a lot of info. No info about inserts/updates/deletes to your table. No info about server. May be you have ndb cluster? Memory table? Just bite on comments, seriously? 🤷‍♂️
0
0
0
@and_ser
maverickmeerkat
5 days
@_kant01 Tbh never saw projects on Django 🤔 Can you show some?
1
0
1
@and_ser
maverickmeerkat
5 days
@ChrisChattin @hutchike @MorriceGavin after_save is called inside transaction. Means that outside async logic that can work with entity could not receive changes, cause they may be not committed yet.
Tweet media one
1
0
4
@and_ser
maverickmeerkat
5 days
@mediafinger @MorriceGavin True! Some people “smear” business logic across different classes & totally don’t understand what SO created for. SO provide straight & stable implementation of certain business logic.
0
0
2
@and_ser
maverickmeerkat
5 days
@ChrisChattin @hutchike @MorriceGavin Running something async in after_save is a very bad idea. If you like callbacks then it should be called in after_commit only ⚠️ That’s why in our team we’re trying avoid any model callbacks at all. AR models should be responsible for data only.
1
0
2
@and_ser
maverickmeerkat
5 days
@defeed @zilasino It’s cool visually but don’t look in code 😄 Fat models, callbacks hell, problems with dependencies… ooh 😖
1
0
1
@and_ser
maverickmeerkat
5 days
@MorriceGavin SO should be called only from business logic perspective. If you call them from everything - it’s wrong. It shouldn’t be called from models, presenters, form objects & other things that not related to business logic.
0
0
0
@and_ser
maverickmeerkat
7 days
@jkostolansky ChatGPT for problems solving. Writing code without AI cause of company rules. Financial project.
0
0
0
@and_ser
maverickmeerkat
8 days
@_kant01 RoR has everything you need for startup & big projects 👌
0
0
0
@and_ser
maverickmeerkat
8 days
@jonathanfrias99 Yep. Using form objects with active model validations + custom initialize. It provides lightweight class without persistence methods.
1
0
1
@and_ser
maverickmeerkat
8 days
@KevinNaughtonJr git commit -m “fix” git commit -m “one more fix” git commit -m “last fix” git commit -m “fix typo in word ‘fuck’”
0
0
0
@and_ser
maverickmeerkat
8 days
@Mr_Okays @todayyearsoldig I think you’re kidding 😆 Other guys also super masters? Learn physics. To do such things you should hook shoes onto bolts. Period! Everything else is a perfect work of cameraman & producer.
0
0
1