ish_models 0.0.33.195 → 0.0.33.196
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 +4 -4
- data/lib/gallery.rb +4 -3
- data/lib/ish/email_context.rb +35 -10
- data/lib/ish/email_template.rb +4 -1
- data/lib/office/email_action.rb +2 -0
- data/lib/photo.rb +10 -0
- metadata +1 -2
- data/lib/iro/option_price_item.rb-trash +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6734c976f4a39e4643051995a75026a996a4ae8c508944a6e29ed11957071cd3
|
4
|
+
data.tar.gz: a49d33a5c8de3573b443193e6232fd154e9d53711478e6b82d73a4388daa4be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6bc3dbab0f0ea3414495717e8bd0b917f784cdba1968ea45eb4c3d762e3239c1f9295f67015c01c8f9736100c775313e46672aa0be1f361b21ae3a9b092a6c2
|
7
|
+
data.tar.gz: abc1d99ca58a33d8ea0349e2df99a946491a24fdf65b442cf5734125faf998981760aff42a651c3fe8f0a5653bafedde7954e30932205250e2b776761945f203
|
data/lib/gallery.rb
CHANGED
@@ -45,15 +45,16 @@ class Gallery
|
|
45
45
|
|
46
46
|
belongs_to :user_profile, :optional => true, :class_name => 'Ish::UserProfile', :inverse_of => :galleries
|
47
47
|
|
48
|
-
has_many :newsitems #
|
49
|
-
has_many :photos
|
48
|
+
has_many :newsitems # Seems correct. _vp_ 2022-03-21
|
50
49
|
|
50
|
+
has_many :photos, order: { ordering: :asc }
|
51
51
|
|
52
|
+
ACTIONS = [ 'show_mini', 'show_long', 'show' ]
|
52
53
|
# @deprecated, use Gallery::ACTIONS
|
53
54
|
def self.actions
|
54
55
|
ACTIONS
|
55
56
|
end
|
56
|
-
|
57
|
+
|
57
58
|
|
58
59
|
RENDER_TITLES = 'index_titles' # view name
|
59
60
|
RENDER_THUMBS = 'index_thumbs' # view name
|
data/lib/ish/email_context.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Sends a single email
|
4
4
|
#
|
5
5
|
|
6
|
-
class Ish::EmailContext
|
6
|
+
class ::Ish::EmailContext
|
7
7
|
include Mongoid::Document
|
8
8
|
include Mongoid::Timestamps
|
9
9
|
|
@@ -11,14 +11,28 @@ class Ish::EmailContext
|
|
11
11
|
field :slug
|
12
12
|
validates_uniqueness_of :slug, allow_nil: true
|
13
13
|
|
14
|
+
field :preview_str, type: :string
|
15
|
+
def preview_str
|
16
|
+
if self[:preview_str].presence?
|
17
|
+
return self[:preview_str]
|
18
|
+
else
|
19
|
+
return tmpl.preview_str
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
14
23
|
PAGE_PARAM_NAME = 'email_contexts_page'
|
15
24
|
|
16
|
-
FROM_EMAILS =
|
17
|
-
hello@infiniteshelter.com
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
25
|
+
FROM_EMAILS = [
|
26
|
+
'Infinite Shelter <hello@infiniteshelter.com>',
|
27
|
+
'Infinite Shelter <no-reply@infiniteshelter.com>',
|
28
|
+
'Victor Piousbox <piousbox@gmail.com>',
|
29
|
+
'Victor Piousbox <victor@piousbox.com>',
|
30
|
+
'Victor Piousbox <no-reply@piousbox.com>',
|
31
|
+
'Victor Piousbox <admin@wasya.co>',
|
32
|
+
'WasyaCo Consulting <hello@wasya.co>',
|
33
|
+
'WasyaCo Consulting <no-reply@wasya.co>',
|
34
|
+
'Victor Piousbox <victor@wasya.co>',
|
35
|
+
];
|
22
36
|
field :from_email
|
23
37
|
validates_presence_of :from_email
|
24
38
|
def self.from_email_list
|
@@ -31,6 +45,10 @@ class Ish::EmailContext
|
|
31
45
|
field :body
|
32
46
|
|
33
47
|
belongs_to :email_template
|
48
|
+
def tmpl
|
49
|
+
email_template
|
50
|
+
end
|
51
|
+
|
34
52
|
belongs_to :scheduled_email_action, class_name: '::Office::ScheduledEmailAction', optional: true
|
35
53
|
|
36
54
|
field :rendered_str
|
@@ -54,14 +72,21 @@ class Ish::EmailContext
|
|
54
72
|
Ish::EmailContext.where({ :send_at.lte => Time.now })
|
55
73
|
end
|
56
74
|
|
57
|
-
## @deprecated: use self.lead
|
58
|
-
# field :to_email
|
59
|
-
# validates_presence_of :to_email
|
60
75
|
|
61
76
|
field :lead_id
|
62
77
|
def lead
|
63
78
|
Lead.find lead_id
|
64
79
|
end
|
80
|
+
## @deprecated: use self.lead
|
81
|
+
field :to_email
|
82
|
+
def to_email
|
83
|
+
if self[:lead_id]
|
84
|
+
return lead[:email]
|
85
|
+
else
|
86
|
+
return self[:to_email]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
65
90
|
|
66
91
|
##
|
67
92
|
## For tracking / utm
|
data/lib/ish/email_template.rb
CHANGED
@@ -7,6 +7,8 @@ class ::Ish::EmailTemplate
|
|
7
7
|
validates_uniqueness_of :slug
|
8
8
|
validates_presence_of :slug
|
9
9
|
|
10
|
+
field :preview_str, type: :string
|
11
|
+
|
10
12
|
field :layout, type: :string, default: 'plain'
|
11
13
|
LAYOUTS = %w| plain
|
12
14
|
m20221201react m20221222merryxmas
|
@@ -27,7 +29,8 @@ class ::Ish::EmailTemplate
|
|
27
29
|
binding()
|
28
30
|
end
|
29
31
|
|
30
|
-
has_many :email_actions
|
32
|
+
has_many :email_actions, class_name: '::Office::EmailAction'
|
33
|
+
has_many :email_contexts, class_name: '::Ish::EmailContext'
|
31
34
|
|
32
35
|
end
|
33
36
|
::Tmpl = ::Ish::EmailTemplate
|
data/lib/office/email_action.rb
CHANGED
data/lib/photo.rb
CHANGED
@@ -19,7 +19,17 @@ class Photo
|
|
19
19
|
belongs_to :gallery, :optional => true
|
20
20
|
belongs_to :newsitem, :optional => true
|
21
21
|
|
22
|
+
# photo.photo.to_s.split('/').last.split('?').first
|
22
23
|
field :name, :type => String
|
24
|
+
def name
|
25
|
+
return self[:name] if self[:name]
|
26
|
+
update_attribute(:name, self.photo.to_s.split('/').last.split('?').first)
|
27
|
+
name
|
28
|
+
end
|
29
|
+
|
30
|
+
field :ordering, type: :integer
|
31
|
+
index({ ordering: -1 })
|
32
|
+
|
23
33
|
field :descr, :type => String
|
24
34
|
field :subhead
|
25
35
|
field :weight, :type => Integer, :default => 10
|
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.
|
4
|
+
version: 0.0.33.196
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -122,7 +122,6 @@ files:
|
|
122
122
|
- lib/gameui/map_bookmark.rb
|
123
123
|
- lib/gameui/marker.rb
|
124
124
|
- lib/gameui/premium_purchase.rb
|
125
|
-
- lib/iro/option_price_item.rb-trash
|
126
125
|
- lib/ish/cache_key.rb
|
127
126
|
- lib/ish/configuration.rb
|
128
127
|
- lib/ish/crawler.rb
|