On Wednesday, May 11, 2016 at 3:48:17 AM UTC-7, Janko Marohnić wrote: > > But schema parsing isn't strictly related to models, is it? I mean, you > can request `DB.schema(table_name)` without using models, and the schema > *is* cached on the database object. To me it seems that schema parsing is > a Database thing (which the model code uses), and thus it seems to me that > it should be fine that a database extension affects this code. > > Another thing is that the pg_json extension already affects schema > parsing, so isn't the change I'm suggesting still inside the territory that > pg_json covers? >
You could have loading the pg_json (and similar pg_*) extensions modify or clear the Database schema cache, but I don't think that would help your case. When Model.set_dataset is called, it gets the schema from the Database object and transforms it from an array to a hash. So changes to the database schema cache have no effect on models who have already parsed the schema. The two decent options you have are: 1) Fix your app so you have more control over initialization and can set things up correctly (recommended) 2) Reset the dataset for all affected models so that the schema gets reparsed (ugly hack) Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
