```ruby
class ManageIQ::Providers::Amazon::NetworkManager::SecurityGroup < ::SecurityGroup
  has_many :vms, -> { distinct }, :through => :network_ports, :source => :device, :source_type => 'VmOrTemplate'
end
```

Move SecurityGroup relations to base class
user
```ruby
class ManageIQ::Providers::Amazon::NetworkManager::SecurityGroup < ::SecurityGroup
end
```
assistant