Best Ruby On Rails eCommerce Platform: Spree Vs Solidus
Ruby on Rails has been a part of the eCommerce world since 2004 with the launch of an online snowboard store - Snow Devil. The technology has a lot to offer with quality solutions.
I’d like this to be a reasonably detailed overview of how does the upgrade process in Rails look like in general, but with a strong emphasis on Rails 5.2 > 6 upgrade part (RC1 being the latest release). I’ve already seen a number of great posts describing the list of changes that awaits us in Rails 6, so I will skip this entirely and will focus solely on the upgrade.
The Ruby on Rails framework is powerful in many ways. One of its strong points is that Ruby on Rails is being shipped with ActiveRecord - an Object Relational Mapping system. ActiveRecord comes up with its own DSL, which lets you write Ruby code, which in turn is translated to SQL, allowing you to use database native features, including “locking”.
Today we are going to add specs (again, we will focus only on the happy paths) for GraphQL queries. But there is one thing about the current implementation of the queries that I don’t like. We have everything defined in one file: `app/graphql/types/query_type.rb`
In the last article we added a few GraphQL mutations to our test application. It is time to create automated tests for each of them. But first things first, we need to set up `RSpec` in order to write better specs.
In this article, I would like to focus on adding GraphQL mutations. We will be working on the test application we created previously in this article. It might be helpful for you to know the structure, models, and types we are using so I encourage you to take a look.
GraphQL is an open source query language created by Facebook. It is a powerful tool that you can use for building your API. It is not a silver bullet but it can definitely help you solve some challenges like getting many resources in a single request.
If we type Ruby on Rails 2019 in Google we will most likely get results from blog posts and forums dedicated to Ruby’s alleged death, but the truth is, Ruby is doing great and still remains a good technology to choose in 2019 and here is why.
Naming things in programming may not be hard (a matter of imagination), but it is definitely hard to do it right. Also, it turns out to be very unclear what “right” means in each and every context. It doesn’t change the fact that in 8 out of 10 PRs I review, I provide a feedback related to naming, be it naming of classes, methods, fields, variables… you name it
In the previous part of this article we focused on making specs we try to write as readable as possible. This however, comes at a cost of duplication and bloated individual tests. While this is a cost we intend to pay, there are ways to mitigate the impact of readability oriented specs on the overall size of our suite.
Form Object is a very useful pattern in rails ecosystem as it can address variety of issues and antipatterns. In this article we will attempt to sort out in which situations Form Objects can prove useful and what conventions allow us to make most out of them.
Clients and Wrappers (also referred to as “Facades”) are remarkably useful tools for working with external services, libraries or APIs. While both Clients and Wrappers are primarily used to facilitate usage of before-mentioned libraries or APIs, there are some significant differences in responsibilities each of these patterns have. In some cases a Wrapper can take over a Client’s responsibilities too