Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Klass
- def initialize
- db = Sequel.connect('sqlite://example.db')
- @items = db[:subscriptions]
- end
- # some code ...
- def check_for_duplicates(m)
- @items.filter(:mail => m).first[:mail] == m
- end
- # some code ...
- end
- obj = Klass.new
- obj.check_for_duplicates('example@gmail.com')
- # can't express #<Klass:0xb772330c @items=#<Sequel::SQLite::Dataset: "SELECT * FROM `subscriptions`">> as a SQL literal
Add Comment
Please, Sign In to add comment