Guest User

Untitled

a guest
Apr 25th, 2018
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class Klass
  2.  
  3. def initialize
  4. db = Sequel.connect('sqlite://example.db')
  5. @items = db[:subscriptions]
  6. end
  7.  
  8. # some code ...
  9.  
  10. def check_for_duplicates(m)
  11. @items.filter(:mail => m).first[:mail] == m
  12. end
  13. # some code ...
  14. end
  15.  
  16. obj = Klass.new
  17. obj.check_for_duplicates('example@gmail.com')
  18.  
  19. # can't express #<Klass:0xb772330c @items=#<Sequel::SQLite::Dataset: "SELECT * FROM `subscriptions`">> as a SQL literal
Add Comment
Please, Sign In to add comment