storage_unit 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: e9b686097ab6166d0cd66e90befe241fe8e0d256
4
- data.tar.gz: 0ffecafa0a2ed6be9eea6c9df9458ae4b6955158
3
+ metadata.gz: 123c75a0205796eeee95d8d58416b98d74e51609
4
+ data.tar.gz: 31a15c73833dd74c5e9b4ed73ae28616db136950
5
5
  SHA512:
6
- metadata.gz: e3dce4c8c63d991a29fb95b81b55e76c4471fd4414b195af8429cf0eee6326d688ef80b5325895c659c0b0fa9c6dc9fb94c73b9e3c9553632e44f18c7522bf8c
7
- data.tar.gz: 21d4d67daffd46dc445769bd42781a512cff16a959b5591fc1727ce46a607680a2ccbbb78293d98424f78f2dfeb8014c63661c66410386857208da52de14f6ff
6
+ metadata.gz: 2b1dbf907e0ea28b62168cb73c829657b78f468757c52e2e405fbcccf1aa7b5197cc4d49598f6f80db6524545d0ae0b82d22b4ad2a7f4f1705f2e8499484248a
7
+ data.tar.gz: 5b2ea9c50b74b8a58741f6273d09d19ca955d12f7f1df46cc0b429a997055453f8dab5601b5904a9d317021352bdd25c3ff655870727f3639e98966c3e3188f4
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.3.1
@@ -3,3 +3,6 @@ cache: bundler
3
3
  script: bundle exec rspec
4
4
  notifications:
5
5
  email: false
6
+ gemfile:
7
+ - gemfiles/rails_5.gemfile
8
+ - gemfiles/rails_4.gemfile
@@ -0,0 +1,7 @@
1
+ appraise 'rails_5' do
2
+ gem 'rails', '5.0.0'
3
+ end
4
+
5
+ appraise 'rails_4' do
6
+ gem 'rails', '4.2.6'
7
+ end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "4.2.6"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "5.0.0"
6
+
7
+ gemspec :path => "../"
@@ -3,30 +3,22 @@ module StorageUnit
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- default_scope { where(with_deleted_scope_sql) }
6
+ default_scope { where(default_scope_hash) }
7
7
  define_model_callbacks :trash
8
8
  define_model_callbacks :recover
9
9
  end
10
10
 
11
11
  module ClassMethods
12
- def with_deleted_scope_sql
13
- all.table[storage_unit_opts[:column]].eq(nil).to_sql
12
+ def default_scope_hash
13
+ { storage_unit_opts[:column] => nil }
14
14
  end
15
15
 
16
- def deleted_only_scope_sql
17
- all.table[storage_unit_opts[:column]].not_eq(nil).to_sql
18
- end
19
-
20
- # lifted from acts_as_paranoid, works around https://github.com/rails/rails/issues/4306
21
- # with this in place Post.limit(10).with_deleted, will work as expected
22
16
  def with_deleted
23
- scope = self.all
24
- scope.where_values.delete(with_deleted_scope_sql)
25
- scope
17
+ self.all.unscope(where: storage_unit_opts[:column])
26
18
  end
27
19
 
28
20
  def deleted_only
29
- with_deleted.where(deleted_only_scope_sql)
21
+ with_deleted.where.not(default_scope_hash)
30
22
  end
31
23
  end
32
24
 
@@ -1,3 +1,3 @@
1
1
  module StorageUnit
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -19,8 +19,9 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.homepage = 'http://github.com/dobtco/storage_unit'
21
21
 
22
- s.add_dependency 'rails', '~> 4.1', '>= 4.1.0'
22
+ s.add_dependency 'rails', '>= 4.1.0'
23
23
 
24
+ s.add_development_dependency 'appraisal'
24
25
  s.add_development_dependency 'coveralls'
25
26
  s.add_development_dependency 'guard-rspec'
26
27
  s.add_development_dependency 'rspec-rails'
metadata CHANGED
@@ -1,22 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storage_unit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Becker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-07-05 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
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.1'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 4.1.0
@@ -24,12 +21,23 @@ dependencies:
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '4.1'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
26
  version: 4.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: appraisal
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
33
41
  - !ruby/object:Gem::Dependency
34
42
  name: coveralls
35
43
  requirement: !ruby/object:Gem::Requirement
@@ -96,10 +104,13 @@ files:
96
104
  - ".gitignore"
97
105
  - ".ruby-version"
98
106
  - ".travis.yml"
107
+ - Appraisals
99
108
  - Gemfile
100
109
  - Guardfile
101
110
  - LICENSE.md
102
111
  - README.md
112
+ - gemfiles/rails_4.gemfile
113
+ - gemfiles/rails_5.gemfile
103
114
  - lib/storage_unit.rb
104
115
  - lib/storage_unit/core.rb
105
116
  - lib/storage_unit/setup.rb