Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maecha/5770f6107d7e0d2514ad5acda32ebb2c to your computer and use it in GitHub Desktop.
Save maecha/5770f6107d7e0d2514ad5acda32ebb2c to your computer and use it in GitHub Desktop.
Create the module for to cast boolean
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