Solving data type problems in Ruby or Make data reliable again

 3r3404. 3r3-31. In this article, I would like to talk about what problems with data types exist in Ruby, what problems I encountered, how they can be solved and how to make the data we work with can be relied upon.
 3r3404.
 3r3404. Solving data type problems in Ruby or Make data reliable again
 3r3404. helps to verify this. Rollbar research. where they analyzed more than 1000 Rail applications and identified the most common errors. And 2 out of 10 most frequent errors are connected with the fact that the object cannot respond to a specific message. And therefore, checking the behavior of an object, what duck typing gives us, in many cases may not be enough.
 3r3404.
 3r3404. We...
+ 0 -

How to download belongs_to to work twice as fast (database_validations gem)

In this article, I will show why you need to use db_belongs_to from 3r3118. database_validations heme instead of the usual belongs_to . 3r33130. database_validations gem . This heme already included validates_db_uniqueness_of , which people liked ( post on Habré ) and now has db_belongs_to which is very easy to implement in your project. db_belongs_to improves performance and ensures data integrity. 3r33130. 3r3125.  

The method does several things for you:

3r3125.  
  •  
    3r3111. Checks for the existence of a valid foreign key constraint ...
+ 0 -

Correspondence between database restrictions and validations

 3r3143. 3r3-31. After some time from the beginning of the development of your project, you may notice that you have inconsistencies between the restrictions in the database and validations in the application. In this article, I explain how gem database_consistency helps you tidy up your database. 3r33130.  3r3143. database_consistency . At the moment, it detects most cases. As a small bonus, it will also prompt a situation where it is possible to save the record from 3r3109. NULL [/b] value in a column with a non-zero limit. 3r33130.  3r3143. 3r33130.  3r3143. Some questions remain ...
+ 0 -

True validation for uniqueness

Every rubist who worked from Ruby on Rails familiar with 3r336. ORM 3r382. ActiveRecord . Let us discuss one of the validations proposed from the box, namely, validation for uniqueness, and why database_validations gem will save the consistency of your database.
 
3r314.
 
Suppose you have a user model with uniqueness on the field email i.e.
 
 
3r3108. class User < ApplicationRecord
validates: email, uniqueness: true
end
3r3117. 3r3118.
 
 
You may already know that this validation performs the following request
 
 
3r340. SELECT 1 FROM users WHERE email = $ 1 ...
+ 0 -

How to change your life by starting the development of the OpenSource project

+ 0 -

Developer Cookbook: DDD Recipes (Part ? Selective Architecture)

 3r33570. 3r3-31.
The introduction of 3r3506. 3r???.  3r33570. 3r? 3516. In previous articles, we identified 3r337. 3r34949 application area. approach and considered 3r3334. The basic methodological principles of Domain Driven Design
. 3r? 3519. 3r???.  3r33570. 3r? 3516. In this article, I would like to identify the main modern approaches to building an enterprise system architecture: Supple, Screaming, Clean and give them their clear interpretation in the form of a complete ready-made solution. 3r? 3519. 3r???.  3r33570. 3r? 3516. Developer Cookbook: DDD Recipes (Part ? Selective Architecture) ...
+ 0 -

Hiring, hunting, training and development of rubists. HR-corner at the conference RubyRussia-2018

 3r3144. 3r3-31. October 6 in the framework of the conference 3–3–32. RubyRussia [/b] A round table was held “Hiring, hunting, training and development of rubists. HR corner ” . More than 30 participants gathered to talk about sore: interviews, hiring, adaptation and development of employees. Eychary, timlids, technical directors - all those involved in the HR processes in the company participated in the round table. 3r33130.  3r3144. 3r33130.  3r3144. In this article we want to share with you the main points and the hottest discussions from this event. 3r33130.  3r3144. 3r33130.  3r3144. 3r314...
+ 0 -

Testing an application on Go as a black box using Rspec

Testing an application on Go as a black box using RspecWell-written tests significantly reduce the risk of “breaking” the application when adding a new feature or fixing an error. In complex systems consisting of several interrelated components, the most difficult is to test their points of contact. 3r33320.  
3r33320.  
In this article I will talk about how we faced the difficulty of writing good tests when developing a component on Go and how we solved this problem using the RSpec library in Ruby on Rails. 3r33320.  
3r311. 3r33320.  
3r33333. Adding Go to the technology stack of the
project. 3r33320.  
One of the projects, which is developed by ...
+ 0 -

5 + 1 case where the REST API specification plays a huge role

 3r3-1041. 3r3-31.
5 + 1 case where the REST API specification plays a huge role 3r31025.  3r3-1041.
. 3r31030.
JSON Schema
which can be used both in the input parameters and in the answers. 3r33942.  3r3-1041. 3r33944. 3r31025.  3r3-1041. 3r3-1027. OpenAPI has a serious drawback - 3r31028. the complexity of the structure and, often, the redundancy
. For a small project, the contents of the JSON specification file can quickly grow to a few thousand lines. In this form, it is impossible to maintain this file manually. This is a serious threat to the very idea of ​​maintaining the current specification as the API evolves. 3r31030. 3r31025.  3r3-1041. 3r3-1027. There are many visual editors that ...
+ 0 -

Ruby Developer Cookbook: Domain Driven Design Recipes (Part ? Application)

Ruby Developer Cookbook: Domain Driven Design Recipes (Part ? Application) 
3r3-31.
Introduction
3r33333.  
3r33333. I would like to talk about the experience of applying DDD practices to an existing Ruby on Rails project. Initially, we had a monolith, which was written 10 years. The main difficulty of the project was rather complex processes and high connectivity. We managed not only to decompose the application into separate services, but also to significantly increase the readability of the code, to make the described processes transparent. 3r33333. 3r33333.  
3r33333. The solution of tasks within the system became predictable, we stopped working with the black box...
+ 0 -