#93: inspecting the state of a named_scope

Solved!
I know named scopes are getting all changed around in Rails 3, but I figured this out a while ago, and then forgot it, came here to find my answer, and realized I never wrote it down. The problem is that when you're building complex chained scopes its often...

#89: view readline history in irb

Solved!
I wanted to view a log of all the lines I'd written in an IRB session, but didn't see a simple equivalent of bash's "history" command.

#85: Colons and special characters in Ultrasphinx queries

Solved!
When I use UltraSphinx, the Ruby API to the Sphinx full-text search engine, queries with certain special characters such as colons (:), at signs (@), and other reserved characters throw an Ultrasphinx::UsageError exception in my query interface. For example...

#81: associated STI subclasses not loading in dev

Solved!
Let's say you have class Chili < ActiveRecord::Base has_many :beans end class Bean < ActiveRecord::Base; end class Pinto < Bean; end Now, let's say you have one chili record that's associated with one pinto (it's a sad chili). If you do this...

#56: Passenger can't find a shared module in Rails

Solved!
I recently put some shared code from a Rails app into a module in app/models/shared/sweepers_module.rb. The module itself was called Shared::Sweepers. I included it in some sweeper classes, and everything worked fine in Mongrel. In Passenger, though, I got...

#55: accessing locals hash within an ActionView partial

Solved!
How do you access the hash of locals you pass into a partial from within that partial?

#53: slicing rexml collections

Solved!
REXML is dumb and doesn't implement normal Ruby enumerable slicing with ranges.

#44: multivalue facet fields in acts_as_solr

Solved!
Solr supports faceted search, which is good, but acts_as_solr has pretty terribly documentation, which is bad.

#37: make url_for() generate a URL for the current page including GET params

Solved!
If you just use url_for() in a view, it will generate the url corresponding to the controller/action/id that generated, but it will leave out the precious GET params.

#35: validating date_select in rails

Solved!
If you use the date_select helper in Rails, setting all fields except for the year will result in MultiparameterAssignmentErrors. You can catch the exception, but it's kind of hard to catch it in a place where you can add errors to a model instance.