[Nitro] Schema Inheritance

Emmanuel Piperakis epiperak at softlab.ece.ntua.gr
Sun Nov 27 23:04:20 EST 2005


Hi,
I have a small problem to report.
class A
  property :koko, String
end

class AA < A
  property :haha, String
end

a = AA.new
b = A[oid] #Fails

undefined method `result' for #<Array:0x407d26e0>

/usr/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/store/sql.rb:955:in 
`read_one'
/usr/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/store/sql.rb:426:in 
`find_one'
/usr/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/entity.rb:127:in `find_one'
./src/controller.rb:82:in `project_sel'
(eval):12:in `project_sel_action'


probably something to do with the following line in sql.rb
Any ideas?

ps. b = A.find(:condition => "oid =#{oid}")[0]
works find... but...it is toooo long

     klass = 
Og::Entity::entity_from_string(res_row.result.flatten[res_row.fieldnum('ogtype')]) 
if klass.schema_inheritance?

Emmanouil Piperakis (epiperak at cs.ntua.gr)
{To explore is Human, to Create is Devine,
  To teach is Primal, to Rule is Sin}



More information about the Nitro-general mailing list