Thank you Jeremy and I agree you’ve got great documentation to which I turn 
frequently, Sorry I missed this detail.

> On Jun 21, 2021, at 5:10 PM, Jeremy Evans <[email protected]> wrote:
> 
> On Mon, Jun 21, 2021 at 4:32 PM John Knapp <[email protected] 
> <mailto:[email protected]>> wrote:
> Greetings and happy summer!
> 
> I'd like to call a method within a query block thus:
> 
>     def age_method
>       42
>     end
> 
>     Artist.where{age > age_method}
> 
> But I'm getting a PG::UndefinedColumn error
> 
> What is the preferred approach?
> 
> This is covered in the virtual row guide:  
> http://sequel.jeremyevans.net/rdoc/files/doc/virtual_rows_rdoc.html 
> <http://sequel.jeremyevans.net/rdoc/files/doc/virtual_rows_rdoc.html> .  You 
> pass an argument to the block and use the argument, instead of relying on 
> instance_exec:
> 
>   Artist.where{|o| o.age > age_method}  
> 
> It's good to review Sequel's documentation, as it is reasonably 
> comprehensive: http://sequel.jeremyevans.net/documentation.html 
> <http://sequel.jeremyevans.net/documentation.html> .  I realize that doing so 
> requires a significant time commitment.
> 
> Thanks,
> Jeremy
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "sequel-talk" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sequel-talk/G41Fm_UYuMk/unsubscribe 
> <https://groups.google.com/d/topic/sequel-talk/G41Fm_UYuMk/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sequel-talk/CADGZSSc4wK2WRGbnMu4Z5sfOy3MmUS0ieLzM57XChWpj9J5Q_Q%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/sequel-talk/CADGZSSc4wK2WRGbnMu4Z5sfOy3MmUS0ieLzM57XChWpj9J5Q_Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/3540BB85-1ACC-4E62-AB83-F6E25A60E435%40skillbank.io.

Reply via email to