ish_models 0.0.33.58 → 0.0.33.59

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
  SHA1:
3
- metadata.gz: d73c7fc9057a840ccdd310d679761b892fc9cff3
4
- data.tar.gz: 5893aec735ad991c95208b14eb5f6e4cc13ea926
3
+ metadata.gz: bef50c4f8ef407bd36558e04017952197f006d62
4
+ data.tar.gz: 944d11f7eb25042fdd72e055d8053a4d566703b2
5
5
  SHA512:
6
- metadata.gz: 8b436094b78efe9a3caee0009bc4237cf0360b89d1ce67cafaef0fce935c1faa664278c2fdd1d6d06e4bf46e470d922259d6a6d44bff909a430e0251600aab75
7
- data.tar.gz: d80ff5cb7a1c6bbb53d53a7b3d21b4742db99f5ea0a77f3a54b37194496670fa2bfb248d3aec377bd106eeda36eb5fba0465a0a4fc74d044d30b077a7bd17b31
6
+ metadata.gz: b3a72b4efe76e65ecb6e9dd71c855a3f037a9b4a7e92cbd457b0c25df28923a338751f8f9e724a3ca48f877337e9da2c788cae3c4ea35d9d528c73d7aeabdefa
7
+ data.tar.gz: 2313fd87be13bdd161d92203fdac4099406db61705a8b2dbd560c2a4f5a459955456b6818961cfc6ee9b4adc2d74df3cf447949d45ef9a5f6aeec38e1bf2f296
@@ -1,3 +1,4 @@
1
+ require_relative 'order_item'
1
2
 
2
3
  class CoTailors::Order
3
4
  include Mongoid::Document
@@ -5,13 +5,22 @@ class CoTailors::OrderItem
5
5
 
6
6
  belongs_to :order, :class_name => 'CoTailors::Order'
7
7
 
8
+ KIND_SHIRT = :shirt
9
+ KIND_PANTS = :pants
10
+ KIND_SUIT = :suit
8
11
  KINDS = [ :shirt, :pants, :suit ]
9
12
  field :kind, :type => Symbol
13
+ validates :kind, :presence => true
10
14
 
11
15
  FABRICS = [ :white, :black, :light_blue, :dark_blue, :dark_green, :pink, :gray ]
12
16
  field :fabric, :type => Symbol
17
+ validates :fabric, :presence => true
13
18
 
14
19
  has_one :measurement, :class_name => 'CoTailors::ProfileMeasurement'
20
+ validates :measurement, :presence => true
21
+
22
+ field :quantity, :type => Integer
23
+ validates :quantity, :presence => true
15
24
 
16
25
  end
17
26
 
@@ -4,10 +4,12 @@ class CoTailors::ProfileMeasurement
4
4
  include Mongoid::Timestamps
5
5
 
6
6
  UNITS = [ :inches, :centimeters ]
7
+ UNITS_INCHES = :inches
8
+ UNITS_CENTIMETERS = :centimeters
7
9
  field :units, :type => Symbol
8
10
 
9
- belongs_to :profile, :class_name => 'IshModels::UserProfile'
10
- belongs_to :order_item, :class_name => 'CoTailors::OrderItem'
11
+ belongs_to :profile, :class_name => 'IshModels::UserProfile', :optional => true
12
+ belongs_to :order_item, :class_name => 'CoTailors::OrderItem', :optional => true
11
13
 
12
14
  ## shirt
13
15
  field :neck_around, :type => Float
data/lib/gallery.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'kaminari/mongoid'
1
2
 
2
3
  class Gallery
3
4
  include ::Mongoid::Document
@@ -95,5 +96,7 @@ class Gallery
95
96
  end
96
97
  ACTIONS = [ 'show_mini', 'show_long', 'show' ]
97
98
 
99
+ field :issue
100
+
98
101
  end
99
102
 
@@ -0,0 +1,30 @@
1
+
2
+ #
3
+ # Campaign
4
+ # _vp_ 20180128
5
+ #
6
+ class Ish::Campaign
7
+ include Mongoid::Document
8
+ include Mongoid::Timestamps
9
+
10
+ store_in :collection => 'ish_campaign'
11
+
12
+ belongs_to :profile, :class_name => 'IshModels::UserProfile'
13
+
14
+ has_and_belongs_to_many :leads, :class_name => 'Ish::Lead'
15
+ has_and_belongs_to_many :unsubscribe_leads, :class_name => 'Ish::Lead'
16
+
17
+ field :subject
18
+ field :body
19
+
20
+
21
+
22
+ field :is_done, :type => Boolean, :default => false
23
+ field :is_trash, :type => Boolean, :default => false
24
+
25
+ field :applied_on, :type => Time
26
+
27
+ field :tag # 'hired_com_ror', not enumerated for now _vp_ 20180103
28
+ field :location
29
+
30
+ end
data/lib/ish/issue.rb ADDED
@@ -0,0 +1,14 @@
1
+
2
+ #
3
+ # Issue
4
+ # _vp_ 20171204
5
+ #
6
+ class Ish::Issue
7
+ include Mongoid::Document
8
+ include Mongoid::Timestamps
9
+
10
+ store_in :collection => 'ish_issue'
11
+
12
+ field :name
13
+
14
+ end
data/lib/ish/lead.rb CHANGED
@@ -11,6 +11,9 @@ class Ish::Lead
11
11
 
12
12
  belongs_to :profile, :class_name => 'IshModels::UserProfile'
13
13
 
14
+ has_and_belongs_to_many :campaigns, :class_name => 'Ish::Campaign', :inverse_of => :leads
15
+ has_and_belongs_to_many :unsubscribe_campaigns, :class_name => 'Ish::Campaign', :inverse_of => :unsubscribe_leads
16
+
14
17
  field :email
15
18
  field :job_url
16
19
 
@@ -68,4 +68,8 @@ class IshModels::UserProfile
68
68
  has_many :addresses, :class_name => '::CoTailors::Address'
69
69
  has_many :orders, :class_name => '::CoTailors::Order'
70
70
 
71
+ def current_order
72
+ self.orders.where( :submitted_at => nil ).first || CoTailors::Order.create( :profile => self )
73
+ end
74
+
71
75
  end
data/lib/ish_models.rb CHANGED
@@ -2,6 +2,8 @@
2
2
  require 'ish_models/railtie' if defined?(Rails)
3
3
  require 'ish_models/configuration'
4
4
 
5
+ ::S3_CREDENTIALS ||= {}
6
+
5
7
  module IshModels
6
8
 
7
9
  class << self
@@ -23,7 +25,7 @@ require 'co_tailors/shirt.rb'
23
25
  require 'co_tailors/suit.rb'
24
26
  require 'co_tailors/profile_measurement.rb'
25
27
  require 'co_tailors/order.rb'
26
- require 'co_tailors/order_item.rb'
28
+ # require 'co_tailors/order_item.rb' # this is required from within order.rb
27
29
  require 'co_tailors/address.rb'
28
30
 
29
31
  require 'ish/gallery_name.rb'
@@ -33,9 +35,11 @@ require 'ish/stock_option.rb'
33
35
  require 'ish/stock_watch.rb'
34
36
  require 'ish/invoice.rb'
35
37
  require 'ish/lead.rb'
38
+ require 'ish/campaign.rb'
39
+ require 'ish/issue.rb'
36
40
 
37
41
  # obsolete, use `ish` namespace now
38
- require 'ish_models/cache_key.rb'
42
+ require 'ish_models/cache_key.rb' # this is really obsolete? _vp_ 20180123
39
43
  require 'ish_models/user_profile.rb'
40
44
 
41
45
  require 'app_model2.rb'
data/lib/report.rb CHANGED
@@ -141,4 +141,6 @@ class Report
141
141
  self.venues[0] || nil
142
142
  end
143
143
 
144
+ field :issue
145
+
144
146
  end
data/lib/site.rb CHANGED
@@ -38,6 +38,7 @@ class Site
38
38
  has_many :tags
39
39
  has_many :videos
40
40
  has_many :newsitems, :order => :created_at.desc
41
+ has_many :issues, :class_name => 'Ish::Issue'
41
42
 
42
43
  embeds_many :features, :order => :created_at.desc
43
44
 
@@ -63,7 +64,7 @@ class Site
63
64
  # manager uses it.
64
65
  def self.list
65
66
  out = self.all.order_by( :domain => :asc, :lang => :asc )
66
- [['Select Site', nil, { :disabled => true }]] + out.map { |item| [ "#{item.domain} #{item.lang}", item.id ] }
67
+ [['Select Site', nil]] + out.map { |item| [ "#{item.domain} #{item.lang}", item.id ] }
67
68
  end
68
69
 
69
70
  def self.mobi
data/lib/video.rb CHANGED
@@ -43,4 +43,6 @@ class Video
43
43
 
44
44
  end
45
45
 
46
+ field :issue
47
+
46
48
  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.58
4
+ version: 0.0.33.59
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -31,33 +31,33 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 6.1.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: devise
34
+ name: mongoid-autoinc
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">"
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0'
39
+ version: '6.0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">"
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: '6.0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: mongoid-autoinc
48
+ name: mongoid-paperclip
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '6.0'
53
+ version: '0'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '6.0'
60
+ version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: kaminari-mongoid
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +72,34 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: 1.0.1
75
+ - !ruby/object:Gem::Dependency
76
+ name: devise
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">"
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">"
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: aws-sdk
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
75
103
  description: models of ish
76
104
  email: victor@wasya.co
77
105
  executables: []
@@ -97,8 +125,10 @@ files:
97
125
  - lib/feature.rb
98
126
  - lib/gallery.rb
99
127
  - lib/gallery2.rb
128
+ - lib/ish/campaign.rb
100
129
  - lib/ish/gallery_name.rb
101
130
  - lib/ish/invoice.rb
131
+ - lib/ish/issue.rb
102
132
  - lib/ish/lead.rb
103
133
  - lib/ish/payment.rb
104
134
  - lib/ish/stock_action.rb