Skip to content

Commit

Permalink
Numeric#from_now/ago is removed, convert to AS::Duration first.
Browse files Browse the repository at this point in the history
Fixes: undefined method `from_now' for 600:Fixnum

See also: rails/rails#12389
  • Loading branch information
jrafanie authored and tenderlove committed Jan 8, 2015
1 parent 16acdf7 commit 3face31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vmdb/app/models/vm_or_template.rb
Expand Up @@ -405,7 +405,7 @@ def powerops_callback(task_id, status, msg, result, queue_item)
end

def self.powerops_expiration
(VMDB::Config.new('vmdb').config.fetch_path(:management_system, :power_operation_expiration) || 10.minutes).to_i_with_method.from_now.utc
(VMDB::Config.new('vmdb').config.fetch_path(:management_system, :power_operation_expiration) || 10.minutes).to_i_with_method.seconds.from_now.utc
end

def self.invoke_tasks_local(options)
Expand Down
2 changes: 1 addition & 1 deletion vmdb/app/models/vmdb_metric/purging.rb
Expand Up @@ -6,7 +6,7 @@ def purge_date(interval)
type = "keep_#{interval}_metrics".to_sym
value = VMDB::Config.new("vmdb").config.fetch_path(:database, :metrics_history, type)
value = value.to_i.days if value.kind_of?(Fixnum) # Default unit is days
value = value.to_i_with_method.ago.utc unless value.nil?
value = value.to_i_with_method.seconds.ago.utc unless value.nil?
value
end

Expand Down

0 comments on commit 3face31

Please sign in to comment.