lib/demoji.rb in demoji-0.0.6 vs lib/demoji.rb in demoji-0.0.7
- old
+ new
@@ -6,15 +6,16 @@
module Demoji
extend ActiveSupport::Concern
included do
- alias_method_chain :create_or_update, :utf8_rescue
+ alias :create_or_update_without_utf8_rescue :create_or_update
+ alias :create_or_update :create_or_update_with_utf8_rescue
end
private
- def create_or_update_with_utf8_rescue
+ def create_or_update_with_utf8_rescue(*)
_rescued_counter ||= 0
create_or_update_without_utf8_rescue
rescue ActiveRecord::StatementInvalid => ex
raise ex unless ex.message.match /Mysql2::Error: Incorrect string value:/