Last active
December 17, 2015 03:48
-
-
Save rafapolo/5545564 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ponto | |
... | |
before_save :detect_overgain | |
def detect_overgain | |
return false if Ponto.where(:identidade_id=>self.identidade.id).where('created_at > ?', 1.day.ago).where(:motivo=>self.motivo).count > 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment