ish_models 0.0.33.182 → 0.0.33.183
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/video.rb +6 -15
- 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: 85f8fca5beb0c5b47064b21cc701211337dc0958413042fe7a0d06760bf37b6d
|
4
|
+
data.tar.gz: 401e647a0822369046967e7a89f1f5e8171a39788c13c599641855497b955532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64946732013186fc3677c73c907a089165534e57b3fbaa064ecd6a4194acf8d9e263b4fd5736f4aab5e726105f76fa960cf396487bf75bf88dce5dec6708acb4
|
7
|
+
data.tar.gz: 299a36f616f7e436f650071604ae9fdc7ae20e23269579b9cb06904be845bfc8516b849022091dfed625bf7eb657f04cb086ca4ff63b92168d27bfcc33632fbe
|
data/lib/video.rb
CHANGED
@@ -29,14 +29,15 @@ class Video
|
|
29
29
|
field :is_public, :type => Boolean, :default => false
|
30
30
|
field :is_feature, :type => Boolean, :default => false
|
31
31
|
|
32
|
-
field :x, :
|
33
|
-
field :y, :
|
32
|
+
field :x, type: Float
|
33
|
+
field :y, type: Float
|
34
|
+
field :z, type: Float
|
34
35
|
|
35
36
|
field :lang, :type => String, :default => 'en'
|
36
37
|
|
37
|
-
field :youtube_id
|
38
|
-
|
39
|
-
|
38
|
+
field :youtube_id
|
39
|
+
validates_uniqueness_of :youtube_id, allow_blank: true, case_sensitive: false
|
40
|
+
before_save { youtube_id.present? || youtube_id = nil }
|
40
41
|
|
41
42
|
belongs_to :user_profile, :optional => true, :class_name => 'Ish::UserProfile', :inverse_of => :videos
|
42
43
|
|
@@ -44,12 +45,6 @@ class Video
|
|
44
45
|
[['', nil]] + Video.unscoped.order_by( :created_at => :desc ).map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
|
45
46
|
end
|
46
47
|
|
47
|
-
set_callback( :create, :before ) do |doc|
|
48
|
-
if doc.is_public
|
49
|
-
doc.city.add_newsitem( doc ) unless doc.city.blank?
|
50
|
-
doc.site.add_newsitem( doc ) unless doc.site.blank?
|
51
|
-
end
|
52
|
-
end
|
53
48
|
|
54
49
|
field :issue
|
55
50
|
field :subhead
|
@@ -84,10 +79,6 @@ class Video
|
|
84
79
|
s3_region: ::S3_CREDENTIALS[:region]
|
85
80
|
validates_attachment_content_type :thumb, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif", 'application/octet-stream' ]
|
86
81
|
|
87
|
-
set_callback :update, :after do |doc|
|
88
|
-
Site.update_all updated_at: Time.now
|
89
|
-
end
|
90
|
-
|
91
82
|
## copy-paste
|
92
83
|
field :premium_tier, type: Integer, default: 0 # how many stars need to spend, to get access? 0 = free
|
93
84
|
def is_premium
|