Skip to content

Instantly share code, notes, and snippets.

@bernardobarreto
Last active December 23, 2017 21:02
Show Gist options
  • Save bernardobarreto/e2f374d2dc36955d7c82be0c70925b26 to your computer and use it in GitHub Desktop.
Save bernardobarreto/e2f374d2dc36955d7c82be0c70925b26 to your computer and use it in GitHub Desktop.
incrementable visits (wrong way)
class Visit
include Mongoid::Document
field :counter, type: Integer
def increment!
self.counter += 1
self.save!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment