On Friday, December 21, 2018 at 9:16:14 AM UTC-8, Danilo Nogueira wrote:
>
> Hi!
>
> I'm developing an Sequel::Dataset extension, and everything seems to be 
> working fine. This is my extension 
> <https://rubygems.org/gems/sequel-asterisk-hunter>.
> I Installed it on a Rails project, and tried it with rails console this 
> way:
>
> $> rails c
> Loading development environment (Rails 5.2.0)
> irb(main):001:0> Sequel::Database.extension :asterisk_hunter
> => 
> #<Proc:0x000055bd67289220@/home/danilo/.rbenv/versions/2.5.1/gemsets/sasson/gems/sequel-5.15.0/lib/sequel/database/misc.rb:38>
> irb(main):002:0> MySequelModel.my_dataset_modules_method.hunt # *hunt is 
> the only method defined in my extension module...*
> Traceback (most recent call last):
>         1: from (irb):4
> NoMethodError (undefined method `hunt' for 
> #<#<Class:0x000055bd671db1e8>:0x000055bd67fe2610>)
>
> I really cannot find the solution, what am I doing wrong?!
>

Sequel::Database.extension sets the extension to be loaded into 
Sequel::Database instances created in the future.  In your case, the 
Sequel::Database instead already exists.  So you should use DB.extension 
:asterisk_hunter, where DB is a reference to your Sequel::Database instance.

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.

Reply via email to