Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...

blog.bigbinary.com

Remember why preloading associations "randomly" uses joined tables or multiple queries? If you don't like the cleverness of this...

1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...

Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

highscalability.com

Awesome battle report from Pinterest trying to scale their setup using different approaches. When you push something to the limit...

github.com

When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...

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

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

In specs, the session never persists but is always a new object for each request. Data put into the session...

developer.mozilla.org

Non-SSL contents on SSL pages are blocked by default Bug 834836 – Turn on pref to block mixed active content...

makandra dev
apidock.com

All columns of a model's database table are automagically available through accessors on the Active Record object.

Sometimes you might want to limit the number of associated records in a has_many association, but cannot add a...

The User-Agent HTTP header identifies the client and is sent by "regular" browsers, search engine crawlers, or other web...

Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.

Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background

ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

web.archive.org

TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...

Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...

mysqlperformanceblog.com

When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...

When creating an ActiveRecord with .new, .create or create!, you cannot set the ID attribute (note: When using Machinist's...