postgresonline.com

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

It smells. Rethink your code design. Code example with makandra/has_defaults: class Post < ActiveRecord::Base has_defaults tags: [] # field in db...

If you need a postgresql extension for your database it isn't a good idea to give your applications database...

Use form models to handle this problem Or soften the validation to validates_presence_of :parent

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

The migration DSL now supports adding and removing foreign keys. They are dumped to schema.rb as well. At this time...

iPads will not trigger click events for all elements. You can fix that, but you don't want to know...

Large projects usually have large test suites that can run for a long time. This can be annoying as running...

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

postgresql.org

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

forum.openoffice.org

If you're a frequent user of LibreOffice, I strongly recommend to checkout out the VLOOKUP function (SVERWEIS in German...

makandra dev
nexts.github.io

Small (1.5 KB) Javascript library that lets you render tables, lists, etc. with hundreds of thousands of items.

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

bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...

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

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

techblog.livingsocial.com

Clever hack using data-attributes to assign labels to cells. It's still a massive duplication of code (labels), but...

railscasts.com

See this Railscast. Basically you can simply write views like index.xlsx.erb: ID Name Release Date Price <% @products.each do |product| %> <%= product.id...

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

robots.thoughtbot.com

Good article about window functions. Also note how they use a postgres feature called common table expressions.