Created
June 8, 2012 17:31
-
-
Save simeonwillbanks/2897084 to your computer and use it in GitHub Desktop.
Mixin Idea To Force UTF-8 #rails #ActiveRecord #utf8 #mixin
This file contains hidden or 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 Utf8able | |
extend ActiveSupport::Concern | |
included do | |
before_save do | |
# introspect attributes | |
# filter on text like | |
# force_utf8 | |
end | |
end | |
end | |
# Usage | |
# class Foo < ActiveRecord::Base | |
# include Utf8able | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment