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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab9ab58fbdd675ba653fecc53922fe73e06f1f8664f96b71b4be65eaff96f937
4
- data.tar.gz: b41ae3d27c737d8555666e8bb8a36ba10e24d8ff9fb4f31e1ed490392ad1231b
3
+ metadata.gz: 2955b69e5c3cb7c88715600adfc9a661d18bc5a244a91d39f16528152d0bbcc5
4
+ data.tar.gz: 898ce52f6c280db8503702374b64a34f7ecb20b8bcce9dc2d333e468e7577013
5
5
  SHA512:
6
- metadata.gz: bb011cfb98cd182ff924472416b69a578e70c7c63f48da960b70221ed7d38d32d0611ae6a447f969db087c177b14d7f135f9d276ea98ba651e5d679bcd20eaf7
7
- data.tar.gz: 8f64e5052dbca35cfea1ebefc000f712003b92c1a48a096e743ef84b13f891b8bf03ddde64989594407e0574a5fc75a525b56983e8e18c8a82cca633e373734a
6
+ metadata.gz: 6e3b705030a52fe4a626fc8c666de6b578ae04dc01ae0a5abb44d505fe48be96e567d197848be5462ce291ed6f6419a32ba8d78dae5d5e05d55a2ec42bd400df
7
+ data.tar.gz: f3f899139297bd7e575a36562014f43df35791b8d0829c2830a19fc2e706adcf09f9c23925b57efafdbe71a59efd408039dcbc9f91bfba3309fcadfd478ccf87
@@ -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
@@ -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
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.180
4
+ version: 0.0.33.182
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox