Nothing special with my class:

class Target < ActiveRecord::Base

   attr_accessor :hit_sequence_accession,
                 :hit_sequence_desc,
                 :hit_sequence_ID

   def initialize(hit_sequence_accession,
               hit_sequence_desc,
               hit_sequence_ID)
   @hit_sequence_accession = hit_sequence_accession
   @hit_sequence_desc = hit_sequence_desc
   @hit_sequence_ID = hit_sequence_ID
   end

end

There's no targets table in the DB. i'm trying to create a custom dto 
class with data from two tables:

@targets = Target.find_by_sql("SELECT hit_sequence_accession, 
hit_sequence_desc, " +
  "hit_sequence_ID FROM hit_sequence " +
  "JOIN sequence_db USING(sequence_db_ID) ")

   But doing:

p @targets[0].attributes["hit_sequence_ID"]

   gets me this error messagge:


ActiveRecord::StatementInvalid in SearchController#do_search_targets

Mysql::Error: #42S02Table 'srnadb_chlamy_dev_rails.targets' doesn't 
exist: SHOW FIELDS FROM targets

-- 
Posted via http://www.ruby-forum.com/.