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?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.