scopelist 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/CHANGELOG.md +3 -0
- data/README.md +2 -0
- data/gemfiles/4.0.gemfile +7 -0
- data/gemfiles/4.1.gemfile +7 -0
- data/lib/scopelist.rb +5 -2
- data/lib/scopelist/version.rb +1 -1
- data/spec/scopelist_spec.rb +6 -0
- metadata +21 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65a84c44246b2c3a0afd99270ca15a548b7c3f79
|
4
|
+
data.tar.gz: e73c35ca2cea404fd2ce8b51dd74564ec67751c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6e54c03dd9bd85dfb6a980fbe62a8fdc9400098f2dcaeea82d46740d4d28b6e3b20783d5b415808d8e95db057f8e4847bfc6b4bfc277282798664b953a07a3
|
7
|
+
data.tar.gz: a3660ed398bf5508f037233eb0f085e31bd72a1c4cfc71d6165dc038faee967b0d1b57fe2144294a3e4b9d8088cc59f592f930fac85ff8c35590c78fd3c44d02
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,8 @@ A simple way to track scopes in ActiveRecord 4.0 and 4.1.
|
|
4
4
|
|
5
5
|
NOTE: Only Ruby 1.9.3 and later are supported
|
6
6
|
|
7
|
+
[![Build Status](https://travis-ci.org/t27duck/scopelist.svg?branch=master)](https://travis-ci.org/t27duck/scopelist)
|
8
|
+
|
7
9
|
## Installation
|
8
10
|
|
9
11
|
Add this line to your application's Gemfile:
|
data/lib/scopelist.rb
CHANGED
@@ -13,17 +13,20 @@ module Scopelist
|
|
13
13
|
|
14
14
|
module ClassMethods
|
15
15
|
def scope_with_scopelist(name, body, &block)
|
16
|
-
|
16
|
+
additional_available_scope name
|
17
17
|
scope_without_scopelist(name, body, &block)
|
18
18
|
end
|
19
19
|
|
20
20
|
def available_scopes
|
21
21
|
@available_scopes ||= []
|
22
|
+
@available_scopes.dup
|
22
23
|
end
|
23
24
|
|
24
25
|
def additional_available_scope(name)
|
25
|
-
available_scopes
|
26
|
+
@available_scopes ||= []
|
27
|
+
@available_scopes << name.to_sym
|
26
28
|
end
|
29
|
+
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
data/lib/scopelist/version.rb
CHANGED
data/spec/scopelist_spec.rb
CHANGED
@@ -12,6 +12,12 @@ describe '.available_scopes' do
|
|
12
12
|
it 'does not bleed into other models' do
|
13
13
|
expect(SomeOtherThing.available_scopes).to eq([])
|
14
14
|
end
|
15
|
+
|
16
|
+
it 'cannot be mutated' do
|
17
|
+
expected = SomeThing.available_scopes.dup
|
18
|
+
SomeThing.available_scopes << :scope2
|
19
|
+
expect(SomeThing.available_scopes).to eq(expected)
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
23
|
describe '.additonal_available_scope' do
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scopelist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Drake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.0.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
26
|
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 4.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: sqlite3
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Adds ability to track scopes on ActiveRecord models
|
@@ -101,12 +101,15 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
105
106
|
- CHANGELOG.md
|
106
107
|
- Gemfile
|
107
108
|
- LICENSE.txt
|
108
109
|
- README.md
|
109
110
|
- Rakefile
|
111
|
+
- gemfiles/4.0.gemfile
|
112
|
+
- gemfiles/4.1.gemfile
|
110
113
|
- lib/scopelist.rb
|
111
114
|
- lib/scopelist/version.rb
|
112
115
|
- scopelist.gemspec
|
@@ -124,17 +127,17 @@ require_paths:
|
|
124
127
|
- lib
|
125
128
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
129
|
requirements:
|
127
|
-
- -
|
130
|
+
- - ">="
|
128
131
|
- !ruby/object:Gem::Version
|
129
132
|
version: '0'
|
130
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
134
|
requirements:
|
132
|
-
- -
|
135
|
+
- - ">="
|
133
136
|
- !ruby/object:Gem::Version
|
134
137
|
version: '0'
|
135
138
|
requirements: []
|
136
139
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.0
|
140
|
+
rubygems_version: 2.2.0
|
138
141
|
signing_key:
|
139
142
|
specification_version: 4
|
140
143
|
summary: Adds ability to track scopes on ActiveRecord models
|