eivid 1.0.9 → 1.1.1

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: 077c29117cf2cded883cfaa9a2fa6357ad7abe30f67c7bc98f2ce53a001bc696
4
- data.tar.gz: 2968dca76bba1938d819fcdd44d982119f8e5811e8db15a91b1700ca1918a063
3
+ metadata.gz: 9246a571186c117fe8a8cedba5908a275eaa74b0bea191fd69f557431a18201a
4
+ data.tar.gz: 860c7a305e0909d59b093cd33fb063542edf0a49632f7c1db83889681a6029a4
5
5
  SHA512:
6
- metadata.gz: 3d97c505a4859479a8046bc0dfdd07b4f291e577d359399e23a6a8e37a4277bb5bfb597cd0edc850e200ca9234409e5ebc89f81308301a96025f7b3788249f90
7
- data.tar.gz: 3bac18de6b24adc6643c2615e889e8846d592b168da890bb4b244455ed9902d97467c72103b0b40d4bd0011fada3406e1a41bc4489e24bad3c787c0f5f04efa6
6
+ metadata.gz: ff72ebf02f8a5f89bb2ffa3ac1e92f7001900588fbbf54fe3764dd2a680003c06776a2100f68952ae4f2515b2213a5b8bbdc423dc01b2f28e9f241cca3bf839c
7
+ data.tar.gz: a62b3655af2be692f16f71fb3bb029000cefff28575eb2f480f900037d11a41924a7dfab8d737a91714b1b345e5a29aa260c09a7a1aceabed1c9bcf6063493b3
@@ -0,0 +1,14 @@
1
+ module Eivid
2
+ class RequestFolderIdJob < ApplicationJob
3
+
4
+ def perform(eivid_owner_id)
5
+
6
+ owner = Owner.find(eivid_owner_id)
7
+ folder_id = RequestService.create_folder(namespace: Eivid.owner_model, id: owner.id)
8
+
9
+ owner.update!(folder_id: folder_id)
10
+
11
+ end
12
+
13
+ end
14
+ end
@@ -7,7 +7,7 @@ module Eivid::Concerns::MainApp::Owner
7
7
 
8
8
  include Eivid::Concerns::MainApp::VideoConcerns
9
9
 
10
- after_create :create_eivid_owner
10
+ after_commit :create_eivid_owner, on: :create
11
11
 
12
12
  def create_eivid_owner
13
13
  Eivid::Owner.create(external_id: self.id)
@@ -5,16 +5,16 @@ module Eivid
5
5
 
6
6
  validates :external_id, presence: true, uniqueness: true
7
7
 
8
- before_create :get_folder_id
8
+ after_commit :get_folder_id, unless: :folder_id
9
9
 
10
- belongs_to :"#{Eivid.owner_model}", foreign_key: "external_id"
10
+ belongs_to :"#{Eivid.owner_model}", foreign_key: "external_id", optional: true
11
11
 
12
12
  def external_owner
13
13
  send Eivid.owner_model
14
14
  end
15
15
 
16
16
  def get_folder_id
17
- self.folder_id = RequestService.create_folder(namespace: Eivid.owner_model, id: self.external_id)
17
+ RequestFolderIdJob.perform_later(self.id)
18
18
  end
19
19
 
20
20
  end
data/lib/eivid/engine.rb CHANGED
@@ -7,27 +7,23 @@ module Eivid
7
7
 
8
8
  end
9
9
 
10
- class << self
10
+ mattr_accessor :owner_model, :infer_external_owner_id, :notify_front_enabled, :notify_method_on_upload,
11
+ :notify_method_on_video_available, :notify_method_on_versions_available
11
12
 
12
- mattr_accessor :owner_model, :infer_external_owner_id, :notify_front_enabled, :notify_method_on_upload,
13
- :notify_method_on_video_available, :notify_method_on_versions_available
14
-
15
- #sets video owner in the main app
16
- self.owner_model = nil
17
-
18
- # sets how to extract the owner_id in controller actions
19
- self.infer_external_owner_id = "params['external_owner_id'].to_i"
20
-
21
- # sets front end notifiers
22
- self.notify_front_enabled = false
23
- self.notify_method_on_upload = nil
24
- self.notify_method_on_video_available = nil
25
- self.notify_method_on_versions_available = nil
13
+ #sets video owner in the main app
14
+ self.owner_model = nil
15
+
16
+ # sets how to extract the owner_id in controller actions
17
+ self.infer_external_owner_id = "params['external_owner_id'].to_i"
26
18
 
27
- def set_mattr_accessors(&block)
28
- yield self
29
- end
19
+ # sets front end notifiers
20
+ self.notify_front_enabled = false
21
+ self.notify_method_on_upload = nil
22
+ self.notify_method_on_video_available = nil
23
+ self.notify_method_on_versions_available = nil
30
24
 
25
+ def self.set_mattr_accessors(&block)
26
+ yield self
31
27
  end
32
28
 
33
29
  end
data/lib/eivid/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eivid
2
- VERSION = '1.0.9'
2
+ VERSION = '1.1.1'
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eivid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Schrofer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2021-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.3
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.3
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httparty
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,7 @@ files:
80
80
  - app/jobs/eivid/get_vimeo_hd_url_job.rb
81
81
  - app/jobs/eivid/get_vimeo_urls_job.rb
82
82
  - app/jobs/eivid/get_vimeo_urls_mixin.rb
83
+ - app/jobs/eivid/request_folder_id_job.rb
83
84
  - app/jobs/eivid/upload_vimeo_job.rb
84
85
  - app/mailers/eivid/application_mailer.rb
85
86
  - app/models/eivid/application_record.rb