Displaying 2 results from an estimated 2 matches for "52a748a".
Did you mean:
52.748
2009 Aug 05
1
[PATCH server] associated nics w/ network base class as it is in the db
...longs_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/a...
2009 May 15
0
[PATCH server] use service layer for Network controller.
...arams[:type]
+ when 'PhysicalNetwork'
+ return PhysicalNetwork.new(params)
+ when 'Vlan'
+ return Vlan.new(params)
+ else
+ return nil
+ end
+ end
+
+
end
diff --git a/src/app/models/physical_network.rb b/src/app/models/physical_network.rb
index 6923e40..52a748a 100644
--- a/src/app/models/physical_network.rb
+++ b/src/app/models/physical_network.rb
@@ -18,4 +18,8 @@
class PhysicalNetwork < Network
has_many :nics
+
+ def is_destroyable?
+ nics.empty?
+ end
end
diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb
index f7889f4..2f6ac...