Skip to content

Commit

Permalink
[WIP] Adding flavor as a has one on VM
Browse files Browse the repository at this point in the history
I basically want to search Vms like
`vms = Flavor.joins(:vms).where(:flavors => {:name => 't2.micro'})`

so that in the api we can filter by flavor name
  • Loading branch information
Julian Cheal committed Jul 11, 2018
1 parent a572b1a commit dbc6355
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class VmOrTemplate < ApplicationRecord

has_one :miq_server, :foreign_key => :vm_id, :inverse_of => :vm

has_one :operating_system, :dependent => :destroy
has_one :flavor, :foreign_key => :ems_id

has_one :hardware, :dependent => :destroy
has_many :disks, :through => :hardware
belongs_to :host
Expand Down

0 comments on commit dbc6355

Please sign in to comment.