On 10/05/2010 4:44 AM, Jeremy Evans wrote:
Subclass creation is when Sequel queries the database to get the
column information for the model. If the database connection isn't
available, you won't be able to get the columns, and the column
accessors won't be created. It is possible to work around the issues
later by changing the model's dataset, if you have at least a dummy
database set up first. Long story short, the modifications to have it
not raise an error are not extensive, but I think raising an error is
a better default, since otherwise we would have users that complained
that they don't have column accessors for their models (which did
happen before Sequel raised an error in this case).
It might be nice though if this behaviour could be overridden, for
example when using (something like) the set_schema plugin.
class Client < Sequel::Model
set_schema do
<column defs>.....
end
end
Since you've just defined the columns manually there's probably no need
to go to the database to get them, hence you don't need a connection at
this point. I know that set_scehma doesn't do this at present, but
someone with more skills than me might create one that does?
Cheers,
Gary.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.