When using ORDER BY "column" in PostgreSQL, NULL values will come last. When using ORDER BY "column" DESC, NULLs will...

makandra dev
eager.io

SmartUnderline is an open-source JavaScript library which uses clever tricks to draw underlines in a more beautiful and readable...

Today I ran into this: Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]. You need a newer Rubygems version. Try...

Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.

guides.rubyonrails.org

Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to...

postgresql.org

There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...

makandra dev
api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

makandra dev
semaphoreci.com

Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...

Please don't use the horrible datetime_select helper. It has a terrible UI. Always prefer to use a visual...

You might wonder about this request in your test.log: Started GET "/__identify__" for 127.0.0.1 at 2015-04-29 18:00...

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...

When you want to UPDATE a table with information from an associated table, you can JOIN the associated table into...

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...

iana.org

When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...

You can freeze any Ruby object to prevent further modification. If you freeze an ActiveRecord and try to set an...

Rails comes with a Rake task notes that shows code comments that start with "TODO", "FIXME", or "OPTIMIZE".

edgeapi.rubyonrails.org

Starting from Rails 4.0, you can use a special form options helper called #collection_check_boxes. It behaves similar to...

When using threads, you must make your code thread-safe. This can be done by either locking (mutexes) all data...

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

makandra dev

Now supports RSpec 3 and Rails 4 Drops support for state_machine, which has some issues with Rails 4 and...

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

Today I learned that Ruby on Rails has shipped with a built-in slug generator since Rails 2.2:

Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...