lib/rancher/api/models/project.rb in rancher-api-0.4.0 vs lib/rancher/api/models/project.rb in rancher-api-0.5.0
- old
+ new
@@ -1,12 +1,20 @@
# These are 'Environments' in the UI
module Rancher
module Api
class Project
include Her::Model
+ include Helpers::Model
has_many :machines
has_many :environments
has_many :services
+
+ class << self
+ def find_by_name(name:)
+ # filters not working for name yet, so using select
+ all.reject { |e| e.state.eql?('purged') }.select { |e| e.name.eql?(name) }
+ end
+ end
end
end
end