Hi everyone
Recently I thought about adding a feature that allows to find records
by values in a serialized field. For example:
class Article < ActiveRecord::Base
serialize :parameters, Hash
end
let's create a sample article to search for:
article = Article.new
article.title = 'Sample article'
article.parameters = {:foo => "bar"}
article.save
and then when if we wanted to find that article by its :foo value we
could do something like that:
article = Article.where(:parameters => {:foo => "bar"})
Of course the syntax is just an example, not sure how could that look
if implemented.
This would require a database-sided use of regular expressions. But
more importantly, would that feature have a use in Rails?