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: 1f3a34384b57d18db3e94c0979860cf7723fa6e3
4
- data.tar.gz: 3f434860b0ca8f9749a570639643f16bd33465e7
3
+ metadata.gz: d95117cd7da5b071640d9574867eb449140c3a2c
4
+ data.tar.gz: 4c09ec6af2595111d396b71552dfa5ebe77a9765
5
5
  SHA512:
6
- metadata.gz: c69a858299dd6c8a2a3cce3f1a05a9b86c0fdf25fff66fa124f48c7f83735051d828a3c2a8bfc53b978ba01cb3415973703732cdba97087af1748a3c885655fd
7
- data.tar.gz: a4ffcdf75acd0333f868435d13cfebbbbc6fb9b8c84b1298f19c7028f70e34f7689e6a91c633b8217157a901299c4a27da1a9109c4293442a0e63a0e40667c53
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"
@@ -1,3 +1,3 @@
1
1
  module RepositoryManager
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repository-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Baumann