On Apr 25, 1:18 pm, Erwin <[email protected]> wrote: > Thanks Fred for your advice .. this is what I finally did... > I just keep serializing parameters for being used with a proxy object > connector to external services , as the parameters to be used are > different from one connector to another one...
You might want to look at a document store like mongodb, these allow you to store more complex objects as a single document, while still be able to query "inside" them Fred > > On 23 avr, 17:45, Frederick Cheung <[email protected]> wrote: > > > > > On Apr 23, 2:45 pm, Erwin <[email protected]> wrote:> giving a simple > > model, with a serialized Array attribute > > > > class Instructor < User > > > .. > > > serialize :languages, Array > > > > I am looking in defining scopes like this : > > > > >scope speaking_english, lambda { where("languages ... includes.... ?", > > > >:en) } > > > > which look for instructors in which the languages array include ":en" > > > > Is this kind of scope possible ? or not.... ( just using query ) > > > You probably can mash something together with a regular expression > > (although it might be hard to cover all edge cases), but this sounds > > to me like you shouldn't be using serialize, since it makes this sort > > of stuff awkward (and slow, since you can't add indexes that will > > support that sort of query). With a separate join table between users > > and languages it all becomes very simple. > > > Fred > > > > thanks FYF ( For Your Feedback) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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-talk?hl=en.

