Skip to content

Instantly share code, notes, and snippets.

@crispgm
Created July 4, 2017 03:03
Show Gist options
  • Save crispgm/c770514fb36662d4e4d7a93661431af1 to your computer and use it in GitHub Desktop.
Save crispgm/c770514fb36662d4e4d7a93661431af1 to your computer and use it in GitHub Desktop.
Monkey partch to add `this_year?` to Rails
module DateAndTime
module Calculations
def this_year?
year == ::Date.current.year
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment