ish_models 0.0.33.180 → 0.0.33.182
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/email_context.rb +13 -1
- data/lib/ish/email_template.rb +10 -0
- data/lib/video.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2955b69e5c3cb7c88715600adfc9a661d18bc5a244a91d39f16528152d0bbcc5
|
4
|
+
data.tar.gz: 898ce52f6c280db8503702374b64a34f7ecb20b8bcce9dc2d333e468e7577013
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3b705030a52fe4a626fc8c666de6b578ae04dc01ae0a5abb44d505fe48be96e567d197848be5462ce291ed6f6419a32ba8d78dae5d5e05d55a2ec42bd400df
|
7
|
+
data.tar.gz: f3f899139297bd7e575a36562014f43df35791b8d0829c2830a19fc2e706adcf09f9c23925b57efafdbe71a59efd408039dcbc9f91bfba3309fcadfd478ccf87
|
data/lib/ish/email_context.rb
CHANGED
@@ -9,6 +9,13 @@ class Ish::EmailContext
|
|
9
9
|
|
10
10
|
PAGE_PARAM_NAME = 'email_contexts_page'
|
11
11
|
|
12
|
+
FROM_EMAILS = %w| piousbox@gmail.com victor@piousbox.com victor@wasya.co no-reply@piousbox.com |
|
13
|
+
field :from_email
|
14
|
+
validates_presence_of :from_email
|
15
|
+
def self.from_email_list
|
16
|
+
[ [nil, nil] ] + FROM_EMAILS.map { |i| [i, i] }
|
17
|
+
end
|
18
|
+
|
12
19
|
field :to_email
|
13
20
|
validates_presence_of :to_email
|
14
21
|
|
@@ -16,7 +23,7 @@ class Ish::EmailContext
|
|
16
23
|
validates_presence_of :subject
|
17
24
|
|
18
25
|
field :body
|
19
|
-
validates_presence_of :body
|
26
|
+
# validates_presence_of :body ## With plain type, there is no body but there are variables for templating.
|
20
27
|
|
21
28
|
belongs_to :email_template
|
22
29
|
|
@@ -24,5 +31,10 @@ class Ish::EmailContext
|
|
24
31
|
|
25
32
|
field :sent_at, type: DateTime
|
26
33
|
|
34
|
+
#
|
35
|
+
# For templating:
|
36
|
+
#
|
37
|
+
field :name
|
38
|
+
|
27
39
|
end
|
28
40
|
EmailContext = Ish::EmailContext
|
data/lib/ish/email_template.rb
CHANGED
@@ -9,5 +9,15 @@ class ::Ish::EmailTemplate
|
|
9
9
|
|
10
10
|
field :version, default: '0.0.0'
|
11
11
|
|
12
|
+
TYPES = %w| partial plain |
|
13
|
+
field :type
|
14
|
+
def self.type_list
|
15
|
+
[ [nil,nil] ] + TYPES.map { |i| [i, i] }
|
16
|
+
end
|
17
|
+
|
18
|
+
field :subject
|
19
|
+
field :body
|
20
|
+
field :from_email
|
21
|
+
|
12
22
|
end
|
13
23
|
EmailTemplate = ::Ish::EmailTemplate
|
data/lib/video.rb
CHANGED
@@ -35,7 +35,7 @@ class Video
|
|
35
35
|
field :lang, :type => String, :default => 'en'
|
36
36
|
|
37
37
|
field :youtube_id, :type => String
|
38
|
-
validates :youtube_id, :uniqueness => true
|
38
|
+
validates :youtube_id, :uniqueness => true, allow_nil: true
|
39
39
|
|
40
40
|
|
41
41
|
belongs_to :user_profile, :optional => true, :class_name => 'Ish::UserProfile', :inverse_of => :videos
|