repository-manager 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d95117cd7da5b071640d9574867eb449140c3a2c
|
4
|
+
data.tar.gz: 4c09ec6af2595111d396b71552dfa5ebe77a9765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e25618753a71cc94e52c14db8d136565b7a08ac9c35ce1d4bba5ed3c7e48edcb0d75751aa4a624bdf8ae606f3af13dd2633ec4732237d41477e0a8ec1e729f98
|
7
|
+
data.tar.gz: a4d12d3a03d4676f30c51ac51e2b3537d10dfabda6b5e9fe99961c1e6cc4db9ab84c9908a049a94be05f0cc29fcc938f8bbcf1e203633d0e9403fb0c37299e07
|
@@ -17,10 +17,12 @@ class RepositoryManager::RepoItem < ActiveRecord::Base
|
|
17
17
|
validates_presence_of :owner
|
18
18
|
|
19
19
|
if Rails::VERSION::MAJOR == 4
|
20
|
+
scope :root_repo_items, -> { where ancestry: nil }
|
20
21
|
scope :files, -> { where type: 'RepositoryManager::RepoFile' }
|
21
22
|
scope :folders, -> { where type: 'RepositoryManager::RepoFolder' }
|
22
23
|
else
|
23
24
|
# Rails 3 does it this way
|
25
|
+
scope :root_repo_items, where(where ancestry: nil)
|
24
26
|
scope :files, where(type: 'RepositoryManager::RepoFile')
|
25
27
|
scope :folders, where(type: 'RepositoryManager::RepoFolder')
|
26
28
|
end
|
@@ -179,7 +179,7 @@ module RepositoryManager
|
|
179
179
|
|
180
180
|
if file.class.name == 'RepositoryManager::RepoFile'
|
181
181
|
repo_file = file
|
182
|
-
elsif file.class.name == 'File'
|
182
|
+
elsif file.class.name == 'File' || file.class.name == 'ActionDispatch::Http::UploadedFile'
|
183
183
|
repo_file = RepositoryManager::RepoFile.new()
|
184
184
|
repo_file.file = file
|
185
185
|
else # "ActionController::Parameters"
|