[Nitro] "babel": new translation system - suggestions&help wanted
bryan.a.soto at gmail.com
Mon Apr 3 20:17:26 EDT 2006
On 4/2/06, Bryan Soto <bryan.a.soto at gmail.com> wrote:
> On 4/1/06, Stephan Walter <news at stephan.walter.name> wrote:
> > 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
> > 1058:
> > 1059: # causes STI classes to come back as the correct child class
> > 1060: # if accessed from the superclass.
> > 1061:
> > 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)
> > 1064:
> > 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
> > SchemaInheritanceBase?
> Good catch. It's a bug in the Sqlite3 store. Thanks for reporting.
The problem was that Sqlite3 wasn't using the stock fields_for_class
method in SqlStore that accounted for STI. I've fixed in the darcs
Many thanks for reporting.
"Never tell people how to do things. Tell them what to do and they
will surprise you with their ingenuity." —General George S. Patton
More information about the Nitro-general