postgresonline.com

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

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

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...

makandra dev
rails-sqli.org

This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...

The Edge Rider gem gives your relations a method #traverse_association which returns a new relation by "pivoting" around a...

validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...

In theory you can take any scope and extend it with additional joins or conditions. We call this chaining scopes...

dev.mysql.com

The next version of MySQL will include a built-in memcached daemon. This daemon can quickly get and set key/value...

When requests arrive at the application servers simultaneously, weird things can happen. Sometimes, this can also happen if a user...

After you configured your ODBC describe in Fix [RubyODBC]Cannot allocate SQLHENV when connecting to MSSQL 2005 with Ruby 1.8.7...

I followed this nice guide Connecting to MSSQL with Ruby on Ubuntu - lambie.org until I ran in the following errors...

Ever seen this error when using Graticule? Numerical argument out of domain - acos Similarly to the to_sql problem for...