So :age.gt doesn't work anymore? Is there a more up-to-date documentation than the DataMapper.org site?
Thanks for the help. [email protected] On Wednesday, April 3, 2013 at 9:45 PM, Ted Han wrote: > Not quite. Datamapper does two things intelligently. The first is that it > infers what it's supposed to do based on the value of a property. > > So when you say `People.all(age: (start..end))` it'll infer that you want to > look for ages within that range. > > Additionally DataMapper allows you to use structured keys to indicate other > relationships. Early in DataMapper's life, back when it was still okay to > patch core classes, DataMapper by default added some methods on Symbol that > allowed you to say things like :age.gt (http://age.gt) and have that Do The > Right Thing. > > That's fallen out of vogue directly, but you can still use structured keys as > strings. So you should be able to say `People.all("age.gt (http://age.gt)": > 15)` and it'll look for everyone older than 15. > > > On Wed, Apr 3, 2013 at 8:17 PM, [email protected] > (mailto:[email protected]) <[email protected] > (mailto:[email protected])> wrote: > > Ah, I see. > > > > I did notice that zoo.all(population: (start..end)) is valid. I guess > > that's what you meant by "mix the two syntaxes." > > > > > > [email protected] (mailto:[email protected]) > > > > > > On Wednesday, April 3, 2013 at 9:08 PM, Chris Corbyn wrote: > > > > > > > That syntax is not a new Symbol format, it's a new Hash syntax, where the > > > keys are Symbols. You can't use that with DataMapper, since :staff.gt > > > (http://staff.gt) is not a Symbol itself. You can mix the two syntaxes if > > > you want though. > > > > > > Il giorno 04/apr/2013, alle ore 11:50, Gus Shotz <[email protected] > > > (mailto:[email protected])> ha scritto: > > > > How would I write zoo.all(:population.gte => 100, :staff.gt > > > > (http://staff.gt) => 2) using the newer symbol: format? I was hoping I > > > > could do zoo.all(population: >= 100, staff: > 2) but it doesn't work. > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "DataMapper" group. > > > > To unsubscribe from this group and stop receiving emails from it, send > > > > an email to [email protected] > > > > (mailto:[email protected]). > > > > To post to this group, send email to [email protected] > > > > (mailto:[email protected]). > > > > Visit this group at http://groups.google.com/group/datamapper?hl=en. > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to a topic in the > > > Google Groups "DataMapper" group. > > > To unsubscribe from this topic, visit > > > https://groups.google.com/d/topic/datamapper/FDfepXSwXEU/unsubscribe?hl=en. > > > To unsubscribe from this group and all its topics, send an email to > > > [email protected] > > > (mailto:[email protected]). > > > > > > To post to this group, send email to [email protected] > > > (mailto:[email protected]). > > > Visit this group at http://groups.google.com/group/datamapper?hl=en. > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "DataMapper" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to [email protected] > > (mailto:datamapper%[email protected]). > > To post to this group, send email to [email protected] > > (mailto:[email protected]). > > Visit this group at http://groups.google.com/group/datamapper?hl=en. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > You received this message because you are subscribed to a topic in the Google > Groups "DataMapper" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/datamapper/FDfepXSwXEU/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > Visit this group at http://groups.google.com/group/datamapper?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/datamapper?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
