ish_models 3.1.0.13 → 3.1.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c46fe1a3c912f44bfea7b3c8860504d9e43dc58ac5c61d2b78f54d9b3604d5df
4
- data.tar.gz: 24db6889ed4f929a9efb76f8ecb583923468902b49b41a189c2552d0d68ecfa9
3
+ metadata.gz: 878db6bcfd78a87582b23a3edf1fae48aba69227e3147867bb72dc27cf6e4fee
4
+ data.tar.gz: 6dd6d2b220b3c5ee8898cbe0801ccadc4f76a1a4247e5086fd825bb1d7988cd1
5
5
  SHA512:
6
- metadata.gz: 47ad49ab1c7a3890c57da215dbdc261d0d04d55b61d8c1f1e286bccbed161f445f69a73e9fee8ad2a4c6e24be2b1d18fc9ebffdd61df085f78e00779799893be
7
- data.tar.gz: 89322ee3df01c880d551299c79f13015fb80e25fb31d9e3a73f09e8d7ed34ebc74e550d33acee70680484f38cf14d94e59dcc9b7e05802592436fcdb1e226f37
6
+ metadata.gz: c1cdd9e7fa1872d4af5df0aefe4af23edd0f8a00a6e6acbf6feccd0298f4a61d1b3a522a31f8de134c0174adfc62b5625b06cf7aba2635a89d7788a05431d557
7
+ data.tar.gz: 6a6d9e6467c0eb65a982bda906e83cfd628577a7f24fe6d04bebb5a3349bbf77eae1abf38e4b44e69dc911e93dd9ef19516cf191b5eb82ec504b79b0ba43137d
data/lib/wco/leadset.rb CHANGED
@@ -13,8 +13,8 @@ class Wco::Leadset
13
13
  index({ email: 1 }, { name: 'email' })
14
14
  validates :email, presence: true, uniqueness: true
15
15
 
16
- has_many :profiles, class_name: 'Wco::Profile', inverse_of: :leadset
17
- has_many :appliances, class_name: 'WcoHosting::Appliance', inverse_of: :leadset
16
+ has_many :profiles, class_name: 'Wco::Profile', inverse_of: :leadset
17
+ has_many :appliances, class_name: 'WcoHosting::Appliance', inverse_of: :leadset
18
18
 
19
19
  has_many :serverhosts, class_name: 'WcoHosting::Serverhost', inverse_of: :leadset
20
20
  def next_serverhost
data/lib/wco/profile.rb CHANGED
@@ -12,4 +12,8 @@ class Wco::Profile
12
12
 
13
13
  belongs_to :leadset, class_name: 'Wco::Leadset', inverse_of: :profile, optional: true
14
14
 
15
+ def self.list
16
+ all.map { |p| [ p.email, p.id ] }
17
+ end
18
+
15
19
  end
@@ -27,13 +27,12 @@ class WcoHosting::Appliance
27
27
  "#{subdomain}.#{domain}"
28
28
  end
29
29
 
30
- belongs_to :appliance_tmpl, class_name: 'Wco::ApplianceTmpl'
30
+ belongs_to :appliance_tmpl, class_name: 'WcoHosting::ApplianceTmpl'
31
31
  def tmpl
32
32
  appliance_tmpl
33
33
  end
34
34
 
35
- belongs_to :serverhost, class_name: 'Wco::Serverhost'
36
- belongs_to :wco_leadset, class_name: 'Wco::Leadset', inverse_of: :appliances
35
+ belongs_to :serverhost, class_name: 'WcoHosting::Serverhost'
37
36
 
38
37
  # field :ip
39
38
  field :port
@@ -47,7 +47,7 @@ class WcoHosting::ApplianceTmpl
47
47
  KIND_JENKINS, KIND_MATOMO, KIND_MOODLE, KIND_PRESTASHOP, KIND_SMT,
48
48
  KIND_WORDPRESS ]
49
49
 
50
- has_many :appliances, class_name: 'Wco::Appliance'
50
+ has_many :appliances, class_name: 'WcoHosting::Appliance'
51
51
 
52
52
  def self.latest_of kind
53
53
  where({ kind: kind }).order_by({ version: :desc }).first
@@ -7,13 +7,10 @@ class WcoHosting::Serverhost
7
7
  # include Mongoid::Autoinc
8
8
  store_in collection: 'wco_serverhosts'
9
9
 
10
- field :name, type: :string
11
- # validates :name, uniqueness: { scope: :leadset_id }, presence: true
12
- validates :name, uniqueness: { scope: :wco_leadset }, presence: true
10
+ field :name, type: :string
11
+ validates :name, uniqueness: { scope: :leadset }, presence: true
13
12
 
14
- # field :leadset_id, type: :integer
15
- # has_and_belongs_to_many :leadsets, class_name: 'Wco::Leadset', inverse_of: :serverhosts
16
- belongs_to :wco_leadset, class_name: 'Wco::Leadset'
13
+ belongs_to :leadset, class_name: 'Wco::Leadset'
17
14
 
18
15
  field :next_port, type: :integer, default: 8000
19
16
 
@@ -136,5 +133,9 @@ class WcoHosting::Serverhost
136
133
  puts 'ok #create_volume'
137
134
  end
138
135
 
136
+ def self.list
137
+ [[nil,nil]] + all.map { |s| [s.name, s.id] }
138
+ # all.map { |s| [s.name, s.id] }
139
+ end
139
140
 
140
141
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.13
4
+ version: 3.1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - mac_a2141
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-17 00:00:00.000000000 Z
11
+ date: 2023-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails