Skip to content

Instantly share code, notes, and snippets.

Created January 26, 2016 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ed22489306f0a688a52b to your computer and use it in GitHub Desktop.
Save anonymous/ed22489306f0a688a52b to your computer and use it in GitHub Desktop.
class Sequel::Dataset
def has(h)
self.where(h).count > 0
end
def ins_uniq(data, fld)
insert(data) unless has( fld.to_sym => data[fld] )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment