[Rails] Re: Complex finds - part 2

2009-07-30 Thread Matt Jones
The issue is that your generated query is missing parentheses. Why have you tried everything EXCEPT putting them in the SQL fragment? To wit: @debts = Debtortranstaxes.find(:all, :conditions => ["taxauthid IN (?)", @taxauthids]) --Matt Jones On Jul 29, 1:44 pm, Craig White wrote: > On Wed, 200

Re: ****[Rails] Re: Complex finds - part 2

2009-07-29 Thread Hassan Schroeder
On Wed, Jul 29, 2009 at 7:14 AM, Craig White wrote: > If anyone has recommendations on Rails search plugins for current Rails, > I would gladly welcome. I have applications running using acts_as_ferret (very easy to set up) and acts_as_solr (works well for multi-system config). FWIW, -- Hassan

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 22:20 +0200, Marnen Laibow-Koser wrote: > Craig White wrote: > [...] > > thanks - I have used Rails quite a bit but have always used ez-where > > (Rails 1.1/1.2) and it made it easy for me to do finds. > > I'm not familiar with ez-where, but it sounds like it's made it possi

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: [...] > thanks - I have used Rails quite a bit but have always used ez-where > (Rails 1.1/1.2) and it made it easy for me to do finds. I'm not familiar with ez-where, but it sounds like it's made it possible for you to do lots of things without understanding the underlying SQL

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 20:17 +0200, Marnen Laibow-Koser wrote: > Craig White wrote: > > On Wed, 2009-07-29 at 19:46 +0200, Marnen Laibow-Koser wrote: > >> > also - see previous examples from previous e-mail > >> > >> I did. Please take the time to understand where your errors are coming > >> fro

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: > On Wed, 2009-07-29 at 19:46 +0200, Marnen Laibow-Koser wrote: >> > also - see previous examples from previous e-mail >> >> I did. Please take the time to understand where your errors are coming >> from. > > OK, I understand now...wow, was that every difficult. If you

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 19:46 +0200, Marnen Laibow-Koser wrote: > Craig White wrote: > [...] > > I have traced parens around, inside, outside and nothing works... > > Because none of your examples address the problem. The problem is in > your *SQL* syntax, so the parentheses need to be in the SQL

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: [...] > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > '24','25','26','27') > > This just simply does not work. I think that even though I am not the > most knowledgeable Rails user, this suggests unacceptable state of > affairs for current Rails. No, it suggests th

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: [...] > I have traced parens around, inside, outside and nothing works... Because none of your examples address the problem. The problem is in your *SQL* syntax, so the parentheses need to be in the SQL query string -- :conditions => '...and id IN (?)'. Your Ruby syntax is

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 10:35 -0700, Craig White wrote: > On Wed, 2009-07-29 at 19:24 +0200, Marnen Laibow-Koser wrote: > > Craig White wrote: > > Note that I said: > > >> (You might need parentheses around :ids in the query. I'm not sure.) > > > > Note that the generated query is > > [...] > > >

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 19:24 +0200, Marnen Laibow-Koser wrote: > Craig White wrote: > Note that I said: > >> (You might need parentheses around :ids in the query. I'm not sure.) > > Note that the generated query is > [...] > > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > > '24','25',

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: Note that I said: >> (You might need parentheses around :ids in the query. I'm not sure.) Note that the generated query is [...] > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > '24','25','26','27') So it looks like adding the parentheses will fix your problem. >

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
On Wed, 2009-07-29 at 16:55 +0200, Marnen Laibow-Koser wrote: > Craig White wrote: > [...] > > What I want to do is rather complex and ez-where handled this for me > > simply. I want to... > > > > @debtor = Debtortrans.find(:all, > > :conditions => ["trandate > ? and trandate < ? AND taxauthid

[Rails] Re: Complex finds - part 2

2009-07-29 Thread Marnen Laibow-Koser
Craig White wrote: [...] > What I want to do is rather complex and ez-where handled this for me > simply. I want to... > > @debtor = Debtortrans.find(:all, > :conditions => ["trandate > ? and trandate < ? AND taxauthid = ?", > @per1, @per2, "24"], > :joins => 'LEFT JOIN debtortranstaxes ON >

Re: ****[Rails] Re: Complex finds - part 2

2009-07-29 Thread Craig White
ez-where doesn't seem to work correctly with 2.3.2 and I have written an e-mail to Ezra to see if he has noticed problems with current rails. So I am once again looking for search utilities that make it easier to build complex searches and so far I have found Squirrel but don't want to have to in

Re: ****[Rails] Re: Complex finds - part 2

2009-07-28 Thread Craig White
Thanks...I can't walk without my crutch. You made my day. Craig On Tue, 2009-07-28 at 14:15 -0700, Rick wrote: > Check out http://github.com/ezmobius/ez-where/tree/master. Most > recent change activity is Feb 2009 - Rails 2.2. Looks to be the same > Ezra and it might be a better place to start

[Rails] Re: Complex finds - part 2

2009-07-28 Thread Rick
Check out http://github.com/ezmobius/ez-where/tree/master. Most recent change activity is Feb 2009 - Rails 2.2. Looks to be the same Ezra and it might be a better place to start from. On Jul 28, 3:39 pm, Craig White wrote: > I am learning new, was comfortable with 1.2.x > > I always used Ezra'