This gist was writen in 2012 and it was solving specific problem in Rails & SimpleForm. Some fellow developers were pointing out this may be out dated concept. That's why I advise everyone to read comment section bellow to have a full grasp of alternative solutions
other sources that may be helpful to understand why this may not be best idea:
It turns out that if you're using Mongoid, then Boolean is declared as a class inside of Mongoid. This prevents the gist from working if using Mongoid since it's trying to redefine Boolean as a module. So I've forked the gist and renamed the module Boolean to BooleanToBoolean.