On Jun 8, 4:28 pm, Adrian Madrid <[email protected]> wrote:
> It is not a big deal but it seems that when you use an specific
> dataset Sequel will still check for the default table name dataset
> still. I have included the relevant code and log results in this
> gist:
>
> http://gist.github.com/430788
>
> I'm including the code for the lazy in us:
>
> module Weird
>   class Metadata < Sequel::Model
>     set_dataset :metadatas
>     plugin :single_table_inheritance, :type
>   end
> end
>
> class Weird::Citation < Weird::Metadata
> end
>
> and the relevant log:
>
> Mysql::Error: Table 'weird.metadatum' doesn't exist: DESCRIBE
> `metadatum`
> Mysql::Error: Table 'weird.metadatum' doesn't exist: SELECT * FROM
> `metadatum` LIMIT 1
>
> Although it complains it later saves the daa in the right place. In
> short it seems Sequel is checking the default table name but then it
> figures it out. this might be more complicated because it is using STI
> and I am also on Ruby 1.9.2 but it seems weird anyway.
>
> Any ideas?

Expected behavior, because the queries are sent during model subclass
creation.  You can avoid them by doing:

  module Weird
    class Metadata < Sequel::Model(:metadatas)
      plugin :single_table_inheritance, :type
    end
  end

Jeremy

-- 
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.

Reply via email to