ish_models 0.0.33.37 → 0.0.33.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df419d1e60b948cbbae92cd29f604836b056b6fa
4
- data.tar.gz: aca537097bceb483a5d067638873a43aa76b3382
3
+ metadata.gz: a36a759d3c5df00858b7b4a4b156effa6a115b98
4
+ data.tar.gz: 7743095516d016ee85723704a9359b420eb896f5
5
5
  SHA512:
6
- metadata.gz: 565a24d11f3980803458ee022bce63f59b79fee75e2c4b39cf6853e80b6f94fdcb0a85a3f82291e462e1e4c119ff8953578716bb06f1860bc7bf2d8bd4ee27fa
7
- data.tar.gz: c4a1368e86cce3d3ff050f0228050c355f818dd5d3b59c2cc5f373adc6e2433dc69253130afc728813e5086243df5d5d238027bbfed1d04a91f20351630df5df
6
+ metadata.gz: 1de9f46e70857aec5db00efc7c8459aecdd111ab954ffcc332d2725df73dcd6fe0c049cec7f3373181eafb84fd1e793a613f5b9276a95442d7cdf37119da563a
7
+ data.tar.gz: 9d7a4574898eb513da47ae7d71c75afcd09c58b548a8a4d79949e5890b7c4bb92f0796f0edf82d0b77be812220e2696c296805dd282d7699b5c333f1c2575f8a
data/lib/gallery.rb CHANGED
@@ -19,9 +19,9 @@ class Gallery
19
19
  belongs_to :site
20
20
  validates :site, :presence => true
21
21
 
22
- belongs_to :user, :optional => true
23
- belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile'
24
- field :username, :type => String
22
+ belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile', :inverse_of => :galleries
23
+ field :username, :type => String # denormalization, not used _vp_ 20171203
24
+ has_and_belongs_to_many :shared_profiles, :class_name => 'IshModels::UserProfile', :inverse_of => :shared_galleries
25
25
 
26
26
  field :name, :type => String
27
27
  validates :name, :uniqueness => true # , :allow_nil => false
@@ -42,6 +42,7 @@ class Gallery
42
42
 
43
43
  has_many :newsitems
44
44
 
45
+
45
46
  set_callback(:create, :before) do |doc|
46
47
  if doc.user_profile && doc.user_profile.username
47
48
  doc.username = doc.user_profile.username
data/lib/ish/lead.rb ADDED
@@ -0,0 +1,25 @@
1
+
2
+ #
3
+ # Lead
4
+ # _vp_ 20171204
5
+ #
6
+ class Ish::Lead
7
+ include Mongoid::Document
8
+ include Mongoid::Timestamps
9
+
10
+ store_in :collection => 'ish_lead'
11
+
12
+ belongs_to :profile, :class_name => 'IshModels::UserProfile'
13
+
14
+ field :email
15
+ field :job_url
16
+ field :company, :default => ''
17
+ field :description
18
+
19
+ =begin
20
+ field :amount, :type => Float
21
+ has_many :payments, :class_name => 'Ish::Payment'
22
+ field :description, :type => String
23
+ =end
24
+
25
+ end
@@ -27,13 +27,18 @@ class IshModels::UserProfile
27
27
  belongs_to :current_city, :class_name => 'City', :inverse_of => :current_users, :optional => true
28
28
  belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide, :optional => true
29
29
 
30
- has_many :galleries
31
- has_many :reports, :inverse_of => :profile
32
- has_many :videos
33
- has_many :photos
30
+ has_many :galleries, :inverse_of => :user_profile
31
+ has_and_belongs_to_many :shared_galleries, :class_name => 'Gallery', :inverse_of => :shared_profiles
34
32
 
33
+ has_many :invoices
34
+ has_many :leads
35
+ has_many :photos
36
+ has_many :reports, :inverse_of => :profile
35
37
  has_many :stocks, :class_name => 'Ish::StockWatch'
38
+ has_many :videos
36
39
 
40
+ has_and_belongs_to_many :friends, :class_name => 'IshModels::UserProfile', :inverse_of => :friendeds
41
+ has_and_belongs_to_many :friendeds, :class_name => 'IshModels::UserProfile', :inverse_of => :friends
37
42
  #
38
43
  # preferences
39
44
  #
data/lib/ish_models.rb CHANGED
@@ -23,6 +23,7 @@ require 'ish/stock_action.rb'
23
23
  require 'ish/stock_option.rb'
24
24
  require 'ish/stock_watch.rb'
25
25
  require 'ish/invoice.rb'
26
+ require 'ish/lead.rb'
26
27
 
27
28
  # obsolete, use `ish` namespace now
28
29
  require 'ish_models/cache_key.rb'
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.37
4
+ version: 0.0.33.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -77,6 +77,7 @@ files:
77
77
  - lib/gallery2.rb
78
78
  - lib/ish/gallery_name.rb
79
79
  - lib/ish/invoice.rb
80
+ - lib/ish/lead.rb
80
81
  - lib/ish/payment.rb
81
82
  - lib/ish/stock_action.rb
82
83
  - lib/ish/stock_option.rb