Skip to content

Commit

Permalink
Fix rails rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skovic committed Jul 20, 2018
1 parent 274c3fd commit fefa6f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.api_allowed_attributes
has_many :hardwares, :through => :vms_and_templates
has_many :networks, :through => :hardwares
has_many :disks, :through => :hardwares
has_many :physical_servers, :foreign_key => :ems_id, :inverse_of => :ext_management_system
has_many :physical_servers, :foreign_key => :ems_id, :inverse_of => :ext_management_system, :dependent => :destroy

has_many :storages, -> { distinct }, :through => :hosts
has_many :ems_events, -> { order("timestamp") }, :class_name => "EmsEvent", :foreign_key => "ems_id",
Expand Down
2 changes: 1 addition & 1 deletion app/models/physical_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PhysicalServer < ApplicationRecord
has_one :host, :inverse_of => :physical_server
has_one :asset_detail, :as => :resource, :dependent => :destroy
has_many :guest_devices, :through => :hardware
has_many :miq_alert_statuses, :as => :resource, :dependent => :destroy
has_many :miq_alert_statuses, :as => :resource, :dependent => :destroy, :inverse_of => :physical_server

scope :with_hosts, -> { where("physical_servers.id in (select hosts.physical_server_id from hosts)") }

Expand Down

0 comments on commit fefa6f1

Please sign in to comment.