Created
April 3, 2018 07:44
-
-
Save maecha/5770f6107d7e0d2514ad5acda32ebb2c to your computer and use it in GitHub Desktop.
Create the module for to cast boolean
This file contains 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
module Concerns | |
module BoolCastable | |
extend ActiveSupport::Concern | |
private | |
def cast_to_boolean(value) | |
ActiveRecord::Type::Boolean.new.cast(value) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment