ish_models 0.0.33.257 → 0.0.33.258

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: 967e2dc82678bca2b5f7ce4e8d8f323da7f6ac3252f01f68ded8efe59cb3e866
4
- data.tar.gz: 43aba5c773bfa6b9d67e17187a3c87fb11c485999dee49aca29b09e1c71788fe
3
+ metadata.gz: 2e1f1bed433ccb852de3a46410a673a4e4552b4f48221f4c286ca15f5b805689
4
+ data.tar.gz: 180e91b85001dbdca3d42a7af78a5dabf7fb6b5aa5e92b153e75e5ac7b1d1e2b
5
5
  SHA512:
6
- metadata.gz: 3eccb193daa2a797a4cd7cf5320f3623a416c5232734eb9eb24bf1d4572ab56a83df200c5674f3be6095b32169642641876b575c94c9e030bbc75574f2b2a552
7
- data.tar.gz: e9cfaa83e47b60e0fd69bbc28eccd42e0e6084655329a45095662d9d7dab06818bf7bdb9f648a18f0e165b3f4e52b414fd642de9881c65f6c675b786d5267e6c
6
+ metadata.gz: ad31349efdde87b88e17797f250a3fc99e7c25fad9d1a38d061a8519f4773e0b30aa065371f9645f025d7390ce3bfecbda8742857139ad96077bcebb1580c8d4
7
+ data.tar.gz: cc3390211ef7febde3b27b4f3bddd9dd4916e1bcd128cb6d5587b89c435bd6435002cafe05bd78ec4c09e812c040587d17db793d1384056273d27c83f09a8eff
@@ -55,6 +55,9 @@ class Ish::UserProfile
55
55
  has_many :reports, inverse_of: :user_profile
56
56
  has_many :videos, inverse_of: :user_profile
57
57
  has_many :newsitems, inverse_of: :profile
58
+ has_and_belongs_to_many :friends, :class_name => '::Ish::UserProfile', inverse_of: :friendeds
59
+ has_and_belongs_to_many :friendeds, :class_name => '::Ish::UserProfile', inverse_of: :friends
60
+ belongs_to :organization, class_name: '::Wco::Organization', inverse_of: :profile
58
61
 
59
62
  def sudoer?
60
63
  %w( piousbox@gmail.com victor@wasya.co ).include?( self.email )
@@ -79,8 +82,6 @@ class Ish::UserProfile
79
82
 
80
83
  field :is_purchasing, type: Boolean, default: false
81
84
 
82
- has_and_belongs_to_many :friends, :class_name => '::Ish::UserProfile', inverse_of: :friendeds
83
- has_and_belongs_to_many :friendeds, :class_name => '::Ish::UserProfile', inverse_of: :friends
84
85
 
85
86
  # used in rake tasks
86
87
  def self.generate delta
data/lib/ish_models.rb CHANGED
@@ -13,6 +13,8 @@ module Manager; end
13
13
 
14
14
  module Office; end
15
15
 
16
+ module Wco; end
17
+
16
18
  module IshModels
17
19
 
18
20
  class << self
@@ -72,6 +74,10 @@ require 'office/email_message'
72
74
  require 'office/email_message_stub'
73
75
  require 'office/scheduled_email_action'
74
76
 
77
+ require 'wco/organization'
78
+ require 'wco/product'
79
+ require 'wco/subscription'
80
+
75
81
 
76
82
 
77
83
 
@@ -0,0 +1,12 @@
1
+
2
+ class Wco::Organization
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+
6
+ field :name
7
+ field :customer_id # stripe
8
+
9
+ has_many :profiles, class_name: '::Ish::UserProfile', inverse_of: :organization
10
+ has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :organization
11
+
12
+ end
@@ -0,0 +1,11 @@
1
+
2
+ class Wco::Product
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+
6
+ field :name
7
+ field :product_id # stripe
8
+
9
+ has_many :subscriptions, class_name: '::Wco::Subscription', inverse_of: :subscription
10
+
11
+ end
@@ -0,0 +1,9 @@
1
+
2
+ class Wco::Subscription
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+
6
+ belongs_to :organization, class_name: '::Wco::Organization', inverse_of: :subscriptions
7
+ belongs_to :product, class_name: '::Wco::Product', inverse_of: :subscriptions
8
+
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.257
4
+ version: 0.0.33.258
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -171,6 +171,9 @@ files:
171
171
  - lib/photo.rb
172
172
  - lib/report.rb
173
173
  - lib/video.rb
174
+ - lib/wco/organization.rb
175
+ - lib/wco/product.rb
176
+ - lib/wco/subscription.rb
174
177
  homepage: https://wasya.co
175
178
  licenses:
176
179
  - Proprietary