A snippet of the carrierwave documentation You might come to a situation where you want to retroactively change a version...
Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...
It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...
When writing Rails migrations to convert a string column to an integer you'd usually say: change_column :table_name...
I recently experienced the error ActiveRecord::StatementInvalid: Mysql2::Error: closed MySQL connection. Apparently this happens when there is a timeout...
There may be reasons to change the locale of your Postgres cluster. A popular one is your development system's...
So you're switching to PostgreSQL from MySQL? Here is some help... General hints on PostgreSQL \? opens the command overview...
Preface: Normally, you would not need this in integrations tests (probably that's why it is so hard to achieve...
Consul 0.10.0 now allows multiple power mappings for nested resources. When using nested resources you probably want two power
When you're writing migrations that do more than changing tables (like, modify many records) you may want some output...
When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...
Shared example groups are a useful RSpec feature. Unfortunately the default directory structure generated by rspec-rails has no obvious...
Extends the Chrome WebInspector so you can debug AngularJS applications and hunt down performance issues. It's really, really good...
When you have files in your .gitignore they won't be considered for changes, but still you might want to...
We tend to use database transactions as a magic bullet to get rid of all our concurrency problems. When things...
Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...
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...
This card shows how to upgrade a Rails 2 application from Rails 2.3.8 through every single patch level up 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...
When you need to find out in which kind of spec you are during run-time, it's definitely possible...
Issue this command: sqlite3 ~/Library/Application\ Support/Dock/*.db "DELETE from apps WHERE title='APP_NAME';" && killall Dock This tells sqlite3 to...