Skip to content

Commit

Permalink
Remove vmdb_database attributes from VmdbDatabaseConnection
Browse files Browse the repository at this point in the history
You can't assign to a virtual column and all the other methods
caused errors
  • Loading branch information
carbonin committed Feb 7, 2019
1 parent 6fa6891 commit 38db7d2
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions app/models/vmdb_database_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ class VmdbDatabaseConnection < ApplicationRecord
virtual_column :task_state, :type => :string
virtual_column :wait_resource, :type => :integer # oid
virtual_column :wait_time, :type => :integer
virtual_column :vmdb_database_id, :type => :integer

virtual_belongs_to :vmdb_database
virtual_belongs_to :zone
virtual_belongs_to :miq_server
virtual_belongs_to :miq_worker
Expand Down Expand Up @@ -49,10 +47,6 @@ def self.log_statistics(output = $log)
end
end

def vmdb_database_id
@vmdb_database_id ||= self.class.vmdb_database.id
end

def address
client_addr
end
Expand Down Expand Up @@ -111,14 +105,6 @@ def to_csv_hash
}
end

def vmdb_database
VmdbDatabase.find_by(:id => vmdb_database_id)
end

def vmdb_database=(db)
self.vmdb_database_id = db.id
end

def miq_worker
@miq_worker ||= MiqWorker.find_current_in_my_region.find_by(:sql_spid => spid)
end
Expand Down

0 comments on commit 38db7d2

Please sign in to comment.