lib/active_object/time.rb in active_object-5.7.0 vs lib/active_object/time.rb in active_object-5.8.0
- old
+ new
@@ -199,10 +199,11 @@
alias_method :count_minutes_until, :count_minutes_since
def count_seconds_since(time)
time = time.to_time if time.respond_to?(:to_time)
+
(to_f - time.to_f).abs
end
alias_method :count_seconds_until, :count_seconds_since
@@ -219,10 +220,9 @@
alias_method :count_years_until, :count_years_since
def format(string)
delimiters = string.scan(/\W+/)
formatters = string.scan(/[a-z0-9_]+/i)
-
string = formatters.map { |unit| "%#{STRING_UNITS.fetch(unit.to_sym)}#{delimiters.shift}" }
strftime(string.join)
end