Put the attached files into your home directory and enjoy. .irbrc defines interesting_methods, which is essentially all methods without...
Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type...
Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions.
The Ruby on Rails security list archive can be found here: http://groups.google.com/group/rubyonrails-security You can subscribe to this mailing...
As Bill Dueber has on his blog, you can call rvm in the shebang to select a Ruby version like...
You have multiple options: Just don't have a type column. All STI magic will be disabled automatically.
When you need to find out in which kind of spec you are during run-time, it's definitely possible...
Note: These instructions are for a quick per-project setup and may require you to change code. If you generally...
Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new...
ActiveRecord translations live in locale.activerecord. ActiveModel translations live in locale.activemodel. To use the same translations for both, use YAML references...
Getting a regular expression from a string in JavaScript is quite simple: new RegExp('Hello Universe'); # => /Hello Universe/
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...
In the following example the method update_offices_people_count won't be called when office_id changes, because it...
You can detect city and country from an IP address by using the GeoLite database. This is a flat file...
You probably haven't configured version control for your project. Go to Project Settings / Version Control and set the director...
When you download or upgrade RVM it has a hardcoded notion which patch level it considers to be "1.9.3".
tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...
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...
All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...
All columns of a model's database table are automagically available through accessors on the Active Record object.