api.rubyonrails.org

ActiveSupport::Notifications provides an instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information...

github.com

We have a new gem Minidusen which extracts Dusen's query parsing and LIKE query functionality. Minidusen can no longer...

guides.rubyonrails.org

ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...

github.com

Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema...

nateberkopec.com

rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...

postgresonline.com

When working with PostgreSQL, you can use pgAdmin as a GUI. While you can do most things just like on...

makandra Curriculum

Read the Rails Guide about Active Record migrations Understand why we never use models in migrations. Checkout the repository...

Web security basics Einführung in die Web Security 🇩🇪 provides essentials for the topic of this card. Read following chapters:

In tests, it is sometimes useful to create records with specific ids. On PostgreSQL this can cause problems: Usually, PostgreSQL...

In this card we will learn to write code that scales with a large number of database records. We will...

makandra Curriculum

Understand why we test: Low defect rate without a QA department. Customer acceptance testing can concentrate on new features...

You know that ActiveRecord caches associations so they are not loaded twice for the same object. You also know that...

Instead of this: Image.order('images.created_at DESC') You can write this: Image.order(created_at: :desc) Not only do you not...

It's generally not trivial to change a datetime's seconds, minutes, etc in SQL. Here is how it works...

SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database' order by table_rows;

If you want to load an SQL dump from an ActiveRecord migration, you might find this to be harder than...

Rails migrations allow you to use a change method whose calls are automatically inverted for the down path. However, if...

makandra dev
github.com

edge_rider is Power tools for ActiveRecord relations (scopes). Please note that some of the functions edge_rider provides have...

When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...

ActiveRecord caches results of SQL queries. If you want to discard the cached results for one model, you can call...

By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...

robots.thoughtbot.com

Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

blog.codeclimate.com

Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...