EdgeRider 0.3.0 adds support for Rails 4.1 and Ruby 2.1. It forward-ports ActiveRecord::Base.scoped to Rails...
Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass a hash to where, it goes through Arel eventually. Rails...
Gem to get Rails 3's new ActiveRecord query interface (where, order) and the new scope syntax (chaining scope definitions) in Rails 2. You also get #to_sql for scopes...
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall to it: its way of applying the orphan_strategy which...
We have two redundant auto-failover FreeBSD load balancers for our Ruby on Rails hosting setup that are connected to the Internet backbone with a 10GE interface pipe. All...
...other components are redundant, too. Interested? See http://railscomplete.de
...Keep in mind that this will not affect processes that are invoked through the Rails console. Put the environment variables into the user's shell configuration (e.g., ~/.bashrc) if you...
...cleaner will take care of this. See How to set up database_cleaner for Rails with Cucumber and RSpec...
You installed some gems that install a binary (like bundle, rake or rails) with code that only works with modern Rubygems versions You downgraded Rubygems to an older...
...require 'mathn' call (usually by wrapping Bundler.require) like this: # config/application.rb MathnWorkaround.intercept do Bundler.require(:default, Rails.env) if defined?(Bundler) # If you require "mathn" manually, put it inside this block. end
Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g. when trying to replicate a presumed bug in ActiveRecord with...
...to your site and still have the serialization of such objects in their session. Rails will then try to rebuild the user's session and raise an error out of...
If you use a form (or form fields) multiple times inside one view, Rails will generate the same id attributes for fields again. This card presents you with a way...
...other schema names when working with a (legacy) application's database. Note that for Rails applications, dropping and recreating the database itself is usually fine in development. You can use...
...param is a string and you don't get the magic type casting that Rails would give you if it was an actual database column. E.g. when you set an...
...More than twice the amount of courses is probably not sensible, booting up rails takes its time, too...
...simple definition of meta-programming macros like the has_many that you know from Rails. Modularity also lets you organize large models into multiple source files in a way that...
...to Cucumber that helps integration-testing command line tools. When your tests involve a Rails test application, your tool's Bundler environment will shadow that of the test application. To...
...be docked to I18n (configured explicitly on plain Ruby, or use .yml files for Rails): "one & two".convert_miscellaneous_characters # => "one and two" "my words".convert_miscellaneous_html_entities...
...column" ASC NULLS FIRST Your indexes will have to specify this as well. In Rails, declare them using add_index :table, :column, order: { column: 'DESC NULLS LAST' } Multiple columns
...param is a string and you don't get the magic type casting that Rails would give you if it was an actual database column. One effect is that when...
Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those strings will get some default encoding, depending on how they...
...need to represent later time values, use the DateTime class. This is also what Rails does when it loads a record from the database that has a DATETIME value which...
...class: 'image-preview' The image_tag will either contain an existing image (rendered by Rails) or be overwritten by Unpoly with an image preview. Testing Here's a Cucumber step...
...using Middleman for some static sites like our blog. Despite being very similar to Rails, Middleman does not add a fingerprint hash to its asset paths by default. This means...