Instantly share code, notes, and snippets.

Embed
What would you like to do?
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