Mohammed Morsi
2009-Aug-05 21:56 UTC
[Ovirt-devel] [PATCH server] associated nics w/ network base class as it is in the db
fixes regression bug that got recently introduced --- src/app/models/network.rb | 2 ++ src/app/models/physical_network.rb | 2 -- src/app/models/vlan.rb | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/models/network.rb b/src/app/models/network.rb index a4b1b8b..89f9876 100644 --- a/src/app/models/network.rb +++ b/src/app/models/network.rb @@ -22,6 +22,8 @@ class Network < ActiveRecord::Base has_and_belongs_to_many :usages, :join_table => 'networks_usages' + has_many :nics + validates_presence_of :type, :message => 'A type must be specified.' validates_presence_of :name, diff --git a/src/app/models/physical_network.rb b/src/app/models/physical_network.rb index 52a748a..f50eeff 100644 --- a/src/app/models/physical_network.rb +++ b/src/app/models/physical_network.rb @@ -17,8 +17,6 @@ # also available at http://www.gnu.org/copyleft/gpl.html. class PhysicalNetwork < Network - has_many :nics - def is_destroyable? nics.empty? end diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb index 217a89c..e34dddc 100644 --- a/src/app/models/vlan.rb +++ b/src/app/models/vlan.rb @@ -19,8 +19,6 @@ class Vlan < Network has_many :bondings - has_many :nics - validates_presence_of :number, :message => 'A number must be specified.' -- 1.6.0.6
Arjun Roy
2009-Aug-05 22:00 UTC
[Ovirt-devel] Re: [PATCH server] associated nics w/ network base class as it is in the db
On 08/05/2009 05:56 PM, Mohammed Morsi wrote:> fixes regression bug that got recently introduced > --- > src/app/models/network.rb | 2 ++ > src/app/models/physical_network.rb | 2 -- > src/app/models/vlan.rb | 2 -- > 3 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/app/models/network.rb b/src/app/models/network.rb > index a4b1b8b..89f9876 100644 > --- a/src/app/models/network.rb > +++ b/src/app/models/network.rb > @@ -22,6 +22,8 @@ class Network< ActiveRecord::Base > > has_and_belongs_to_many :usages, :join_table => 'networks_usages' > > + has_many :nics > + > validates_presence_of :type, > :message => 'A type must be specified.' > validates_presence_of :name, > diff --git a/src/app/models/physical_network.rb b/src/app/models/physical_network.rb > index 52a748a..f50eeff 100644 > --- a/src/app/models/physical_network.rb > +++ b/src/app/models/physical_network.rb > @@ -17,8 +17,6 @@ > # also available at http://www.gnu.org/copyleft/gpl.html. > > class PhysicalNetwork< Network > - has_many :nics > - > def is_destroyable? > nics.empty? > end > diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb > index 217a89c..e34dddc 100644 > --- a/src/app/models/vlan.rb > +++ b/src/app/models/vlan.rb > @@ -19,8 +19,6 @@ > class Vlan< Network > has_many :bondings > > - has_many :nics > - > validates_presence_of :number, > :message => 'A number must be specified.' > >ACK, I can delete networks again. -Arjun
Maybe Matching Threads
- [PATCH server] suggest ip address for nics/bondings on edit host/vm network forms
- [PATCH server] permit many-to-many vms / networks relationship
- permit many-to-many vms / networks relationship redux
- [PATCH server] use service layer for Network controller.
- permit many-to-many vms / networks relationship