Naturaily blogs about Ruby on Rails, Meteor and web development in general.

Importing data to database in Rails 50 times faster than normal

Importing data to database in Rails 50 times faster than normal
Mikołaj Grygiel - Ruby on Rails Developer

Have you ever needed to save lots of records with unique attribute to database using ActiveRecord? Have you noticed how time consuming such task is? I would like to show you how to do it quickly.

Read more

Run services in the background

Run services in the background
Jan Wieczorkowski - Ruby and JavaScript Developer

Some time ago Marcin wrote about basic design patterns in Ruby on Rails. I’d like to go back to Service pattern in this post. I really like it, it's a good idea to place application’s business logic there. At Naturaily we use it quite often.

Read more

Ruby on Rails implementation of a ranking system using PostgreSQL window functions

Ruby on Rails implementation of a ranking system using PostgreSQL window functions
Patryk Szeliga - Rails & Angular Developer

Hello, this article will show, how easily you can add ranking functionality to your project.

Read more

Ruby on Rails view components with Trailblazer Cells

Ruby on Rails view components with Trailblazer Cells
Mikołaj Grygiel - Ruby on Rails Developer

In recent times view components became a really popular web design pattern. View component is standalone part of view, which can be used at many views.

Read more

API authentication using Devise and Doorkeeper (minimal setup)

API authentication using Devise and Doorkeeper (minimal setup)
Jan Wieczorkowski - Ruby and JavaScript Developer

Have you ever tried to setup Devise and Doorkeeper in the simplest possible way, without oauth applications etc? Here it is! In this article, I'll show you in a few easy steps that setup you searched for!

Read more

Basic design patterns in Ruby on Rails

Basic design patterns in Ruby on Rails
Marcin Mantke - Ruby on Rails developer

Not only as programmers, but in day-to-day life, we encounter some problems. Every person has similiar difficulties, and our society has found universal ways, patterns, to solve that problems. As programmers we also have problems, which can be solved by patterns. Our beloved Wikipedia says, that

Read more

Rails on a diet

Rails on a diet
Przemysław Świercz - Ruby on Rails developer

More and more apps are being created with an API support. Growing popularity of Angular.js and Backbone.js makes it even more important part of new projects. Why is that? There is a trend to seperate backend from frontend not only in terms of logic but also to split the project into two seperate ones - pure API backend and client-side-only frontend. What's all the fuss about? It is simple - you have a nice and clear API for a javascript webapplication and therefore you do not need to worry about the assets pipeline and other full-stack projects related issues. And you get an API for mobile devices. For free.

Read more

How to remove old database migrations in Ruby on Rails

How to remove old database migrations in Ruby on Rails
Jacek Hiszpański - Senior Ruby on Rails Developer

Recently we’ve overtaken a big project for maintenance and further development. It’s a Rails application with many models, controllers and of course lots of database migrations. There were about one hundred files in db/migrate directory. The question is: how can we setup development environment with current database structure? Running rake db:migrate would just be a suicide. It won’t simply work, because these migrations were written long time ago and the current code and models implementation don’t fit them. Instead let’s load schema.rb file using this command:

Read more