:from parameter in active record find not well designed?

Posted by potlee on Stack Overflow See other posts from Stack Overflow or by potlee
Published on 2010-06-12T11:51:42Z Indexed on 2010/06/12 12:02 UTC
Read the original article Hit count: 148

Filed under:
|

i got this error:

SQLite3::SQLException: no such column: apis.name: SELECT * FROM examples WHERE ("apis"."name" = 'deep') 

my code

 Api.find :all, :from => params[:table_name], :conditions => {:name => 'deep' }

I need to make a back end rails application which will be used by a silverlight application. one of the requirements is to fetch simple data from the database. i need to be able to query different tables with the same code.(my app has 2000 tables!)

i think it does not make sense for rails to put in "apis" in the WHERE clause. is there any speciic reason for this?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby