lib/active_merchant/billing/compatibility.rb in activemerchant-1.133.0 vs lib/active_merchant/billing/compatibility.rb in activemerchant-1.137.0
- old
+ new
@@ -27,11 +27,11 @@
def self.humanize(lower_case_and_underscored_word)
result = lower_case_and_underscored_word.to_s.dup
result.gsub!(/_id$/, '')
result.tr!('_', ' ')
- result.gsub(/([a-z\d]*)/i, &:downcase).gsub(/^\w/) { $&.upcase }
+ result.gsub(/([a-z\d]*)/i, &:downcase).gsub(/^\w/) { Regexp.last_match(0).upcase }
end
end
end
end
@@ -88,12 +88,12 @@
def add_to_base(error)
add(:base, error)
end
- def each_full
- full_messages.each { |msg| yield msg }
+ def each_full(&block)
+ full_messages.each(&block)
end
def full_messages
result = []
@@ -111,8 +111,8 @@
end
end
end
end
- Compatibility::Model.send(:include, Rails::Model)
+ Compatibility::Model.include Rails::Model
end
end