Open in app

Sign In

Write

Sign In

Dmytro Vasin
Dmytro Vasin

13 Followers

Home

About

Oct 29, 2020

Yet another reason to stop using attr_reader in the code

Recently, walking through my project’s code, I found a line that I want to refactor. Here is the code that I saw: Since there were no other changes/assignments to the instance_variable, I decided to replace order && order.errors.full_messages with order.errors.full_messages I pushed a fixed version and CI started to fail! Then…

Ruby

5 min read

Yet another reason to stop using attr_reader in the code
Yet another reason to stop using attr_reader in the code
Ruby

5 min read


Feb 27, 2019

How to add a custom cop to Rubocop

Задача: In the project, as part of refactoring, we need to change and reduce values to one type in attributes (in tests). For example, such RSpec methods as “describe”, “context”, “it”, “its”, “it_behaves_like” can be called with an optional attributes “freezed_date” or “freezed_time” with a Data value. …

Rubocop

2 min read

How to add a custom cop to Rubocop
How to add a custom cop to Rubocop
Rubocop

2 min read


Oct 30, 2017

Speed up your tests via :build_stubbed

Rspec is very awesome thing that was created for ruby community. Most of us writing tests. But some times in large project our test become really slow. So each launch of test really hurts and it does not meter do you launch your test before commit/push, or launch on CI…

Ruby On Rails

2 min read

Speed up your tests via :build_stubbed
Speed up your tests via :build_stubbed
Ruby On Rails

2 min read


Oct 25, 2017

Decrease complexity of routes in Rails

Sometimes, when you working with large codebase your `routes.rb` files grows really fast and become very dirty. There are several things that makes your routes file bigger: Customisation of devise. Specific gems that mount additional routes (Active Admin, ActionCable) Sidekiq + SidekiqWeb + Basic authentication Namespaces with APP or API All this points leads to one fact — your file grows and it is hard to maintain it.

Ruby On Rails

1 min read

Decrease complexity of routes in Rails
Decrease complexity of routes in Rails
Ruby On Rails

1 min read


Oct 21, 2017

Version inheritance in Carrierwave

Сarrierwave is a popular image upload gem used by the Rails community to upload files to the server. Recently I had a task to upload to type of images into the application. Under the hood the only difference between both of them was the target directory on the server. …

Rails

2 min read

Version inheritance in Carrierwave
Version inheritance in Carrierwave
Rails

2 min read

Dmytro Vasin

Dmytro Vasin

13 Followers
Following
  • Tech - RubyCademy

    Tech - RubyCademy

  • Paul Keen

    Paul Keen

  • Kirill Shevchenko

    Kirill Shevchenko

  • Medium

    Medium

  • Appaloosa Store

    Appaloosa Store

See all (37)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech