ish_models 3.1.0.14 → 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: 1aab599eebe7e7fcb66958056c67d337fc71feddc43f98f562fe28a796e29e69
4
- data.tar.gz: 045e67c9ab3c47f4ec686655e02cad051e908b209081c0e88d6d0e59cb0a3309
3
+ metadata.gz: 878db6bcfd78a87582b23a3edf1fae48aba69227e3147867bb72dc27cf6e4fee
4
+ data.tar.gz: 6dd6d2b220b3c5ee8898cbe0801ccadc4f76a1a4247e5086fd825bb1d7988cd1
5
5
  SHA512:
6
- metadata.gz: 372ba4f962dfdfaad225c65d2480442f88687b9dbcec47e140a3091fe3a10c3a0a6d0b075a0f7820f5ab13538ce981ddc1def307bb52009121118d3c38227e40
7
- data.tar.gz: b00cc88b5c384d4fc683d59529bc3363c0e340387d27407af96162e8f0c53d0de780d250154e3ebaa4d99d6d73dd7d5115d632b93b684c909e240d6b633d37a8
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
@@ -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.14
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-20 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