ish_models 0.0.33.195 → 0.0.33.197

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: b70a61ff2f74f6f8660cd7b745fafb8ee48107d58e1657fbaa4cbafede5dc5cc
4
- data.tar.gz: 3830845cb028c10381b18c1d9ed2088d62363193ec87f0b3935a5765c40067ba
3
+ metadata.gz: 870f3ee936551c8e5369ba7669b3acffc26cf1ad20dfa391e225b792c5150cb1
4
+ data.tar.gz: 80e60e102548a32aefa3f31297c1bd9e73ada07bd495a81114c0f7f8bb81fd44
5
5
  SHA512:
6
- metadata.gz: 5386670c8bde4fab552ce911b51bdc8e2afcbfce9f70acf8a14d411d64fd9a546d5fb1c6e506e4d279be2b07f35e36a3ab9c20812a899cded954411ffcf61cb2
7
- data.tar.gz: d868d099370aa28c5b082ea6a1235732f281220ac197ef8cd994e73f7e87eac7dea2c6e6bad405d9be369b441a9e15e7478b35959f4acbda44e94c66a39062a1
6
+ metadata.gz: 756ceae86e3e087ecb3fc57519b92a2491d52c483d5a2f2485a9942bc3ff56d35d51197515686d490c04f254cb0c1ef50d437234b3ff0cd80495d7436928de2b
7
+ data.tar.gz: f75395a66a15b6db1f47f2bf33dd9a4842b6bbe5cf4b448e394afefa7584209a7b1ab3c7daee361c464f468df8caf7a6053d9033e9ba16821cea2d7939e21d44
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 # seems correct. _vp_ 2022-03-21
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
- ACTIONS = [ 'show_mini', 'show_long', 'show' ]
57
+
57
58
 
58
59
  RENDER_TITLES = 'index_titles' # view name
59
60
  RENDER_THUMBS = 'index_thumbs' # view name
@@ -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 = %w|
17
- hello@infiniteshelter.com no-reply@infiniteshelter.com
18
- piousbox@gmail.com
19
- victor@piousbox.com no-reply@piousbox.com
20
- admin@wasya.co hello@wasya.co no-reply@wasya.co victor@wasya.co
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
@@ -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
@@ -10,6 +10,8 @@ class Office::EmailAction
10
10
  field :slug, type: :string
11
11
  validates :slug, uniqueness: true, allow_nil: true
12
12
 
13
+ field :descr, type: :string
14
+
13
15
  belongs_to :email_template, class_name: '::Ish::EmailTemplate'
14
16
 
15
17
  field :next_in_days, type: :string
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.195
4
+ version: 0.0.33.197
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
@@ -1,8 +0,0 @@
1
-
2
- require 'active_record'
3
-
4
- class ::Iro::OptionPriceItem < ActiveRecord::Base
5
-
6
- self.table_name = 'iro_option_price_items'
7
-
8
- end