[Nitro] "babel": new translation system - suggestions&help wanted

Stephan Walter news at stephan.walter.name
Sat Apr 1 09:20:42 EST 2006


On Sat, 01 Apr 2006 13:26:47 +0200, Kashia Buch wrote:

>> How do I prevent Og from making a db table for Translation?
> class Translation
>    is Og::SchemaInheritanceBase
> end
> this now only creates the "ogtranslation" table, with an additional column
> called "type".

Thanks a lot! However Og seems to have problems evolving the schema
(evolve_schema_cautious is set to false):

DEBUG -- : Field mismatch in 'ogbabel_translation'. Attempting to correct...
 WARN -- : Removing obsolete fields 'pluralization, tablename, item, fieldname, key' from 'ogbabel_translation'!
ERROR -- : Og.setup had problems: SQLite3::SQLException => table ogbabel_translation_backup has 9 columns but 3 values were supplied

When I set evolve_schema to false after that, it starts without errors.
Why does Og want to remove the fields of the child classes?

When accessing the translations, I get the following error:

ERROR -- : undefined method `result' for #<Array:0xb7887920>
/usr/lib/ruby/gems/1.8/gems/og-0.29.0/lib/og/store/sql.rb:1062:in `read_one'
/usr/lib/ruby/gems/1.8/gems/og-0.29.0/lib/og/store/sql.rb:464:in `find_one'
/usr/lib/ruby/gems/1.8/gems/og-0.29.0/lib/og/entity.rb:207:in `find_one'

1057: res_row = res.next
1059: # causes STI classes to come back as the correct child class
1060: # if accessed from the superclass.
1062: klass = Og::Entity::entity_from_string(res_row.result.flatten[res_row.fieldnum('ogtype')]) if klass.schema_inheritance?
1063: obj = klass.og_allocate(res_row, 0)
1065: if options and options[:select]
1066: read_row(obj, res, res_row, 0)
1067: else

Am I doing something wrong, or is Og having trouble with


More information about the Nitro-general mailing list