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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/video.rb +6 -15
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2955b69e5c3cb7c88715600adfc9a661d18bc5a244a91d39f16528152d0bbcc5
4
- data.tar.gz: 898ce52f6c280db8503702374b64a34f7ecb20b8bcce9dc2d333e468e7577013
3
+ metadata.gz: 85f8fca5beb0c5b47064b21cc701211337dc0958413042fe7a0d06760bf37b6d
4
+ data.tar.gz: 401e647a0822369046967e7a89f1f5e8171a39788c13c599641855497b955532
5
5
  SHA512:
6
- metadata.gz: 6e3b705030a52fe4a626fc8c666de6b578ae04dc01ae0a5abb44d505fe48be96e567d197848be5462ce291ed6f6419a32ba8d78dae5d5e05d55a2ec42bd400df
7
- data.tar.gz: f3f899139297bd7e575a36562014f43df35791b8d0829c2830a19fc2e706adcf09f9c23925b57efafdbe71a59efd408039dcbc9f91bfba3309fcadfd478ccf87
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, :type => Float
33
- field :y, :type => Float
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, :type => String
38
- validates :youtube_id, :uniqueness => true, allow_nil: true
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
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.182
4
+ version: 0.0.33.183
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox