sunspot/sunspot — pull request #226 by davidjoliver (2012-05-16 14:13:46+00:00)
Title: Allow symbol or string in :as declaration inside a model's searchable block (or Sunspot.setup)

When specifying a legacy field with :as, like:

searchable do
string :legacy, :as => "legacy_field"
end

Subsequent searches with fielded search:

MyModel.search do
with :legacy, "some value"
end

raise this error: NoMethodError: undefined method `gsub' for :legacy:Symbol

This makes it so a symbol or a string can be used, interchangeably.