scopy 2.0.0 → 3.0.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
  SHA256:
3
- metadata.gz: e356c71afb90675d134342fe20b4faa3fce31b9d282b04e4655a4c710e55b3b4
4
- data.tar.gz: da964167cf6e60ed41b5c7216ad7ecc37c4f618fc68c0b9160b9b5633a4aff01
3
+ metadata.gz: fb9f1042b50dd5958699ea986afe44d6ca843c862d9ff1b00faf7a6eaa59d08f
4
+ data.tar.gz: 0f9f83ba0699543cfd3ba55244399e2f63d96052186024a443b6bb8e7613ea0e
5
5
  SHA512:
6
- metadata.gz: 60dfcf677ddfe01907b89e074bbf203076552397109b4713b8ff351f4b2d3eddd89f652e02911e9216559b0beb8017c6743c57da584dc83e9fb6f6edb7e7a5d9
7
- data.tar.gz: e98b79d8525befee48d99b1795fc033cb81bb7d72bc8cfae6395748162c063eb0fa0a13da99ec5e68698ce565cec9a14c937f5f8284bcc696c3ee0c6a3ea7a05
6
+ metadata.gz: 5598b2503f9f11c3c1382e63840f84be2bec529f4a8d8a650cbfe53140fd91d8c512053ccfb5cbbf69e46723b73294286a28a8ab73af54fb71d31f8b521b16e7
7
+ data.tar.gz: 3c88b4270d6f42c1f51b1d483121254dc44b640cf1d22d9afddb824f637465c102986cd54e03cc7a4c0f5934a72fac1964598fbd5643f55985af36c35d332fee
data/README.md CHANGED
@@ -8,7 +8,6 @@ Scopy provides common ActiveRecord scopes as ActiveSupport model concerns.
8
8
  Common scopes for the following attributes are provided:
9
9
 
10
10
  * `created_at`
11
- * `id`
12
11
  * `name`
13
12
 
14
13
  ## Install
@@ -30,7 +29,6 @@ Include the modules you would like to use in your models:
30
29
  ```ruby
31
30
  class Dog < ActiveRecord::Base
32
31
  include Scopy::CreatedAtScopes
33
- include Scopy::IdScopes
34
32
  include Scopy::NameScopes
35
33
  ```
36
34
 
@@ -67,25 +65,6 @@ Dog.created_in_year(Time.new(2013))
67
65
  # => dogs created in 2013
68
66
  ```
69
67
 
70
- ##### Scopy::IdScopes
71
-
72
- ```ruby
73
- Dog.excluding(123)
74
- # => dogs excluding id 123
75
-
76
- Dog.excluding([1, 2, 3])
77
- # => dogs excluding ids 1, 2, and 3
78
-
79
- Dog.excluding(dog)
80
- # => dogs excluding dog
81
-
82
- Dog.excluding(Dog.where(id: [1, 2]))
83
- # => dogs excluding other dogs
84
- ```
85
-
86
- Note: `.excluding_ids` and `.excluding_id` scopes were removed in
87
- version 2.0. Replace those calls with `.excluding`.
88
-
89
68
  ##### Scopy::NameScopes
90
69
 
91
70
  ```ruby
@@ -101,3 +80,14 @@ Dog.name_starts_with('snOOp')
101
80
  Dog.name_starts_with('Snoop', case_sensitive: true)
102
81
  # => dogs with names starting with 'Snoop' (case sensitive)
103
82
  ```
83
+
84
+ #### Upgrading
85
+
86
+ ##### Version 2.0
87
+
88
+ * `.excluding_ids` and `.excluding_id` scopes were removed in
89
+ version 2.0. Replace those calls with `.excluding`.
90
+
91
+ ##### Version 3.0
92
+
93
+ * `Scopy::IdScopes` was removed in version 3. Use `where.not(id: ids)`.
@@ -1,4 +1,3 @@
1
1
  require "scopy/version"
2
2
  require "scopy/created_at_scopes"
3
- require "scopy/id_scopes"
4
3
  require "scopy/name_scopes"
@@ -1,3 +1,3 @@
1
1
  module Scopy
2
- VERSION = "2.0.0"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tee Parham
@@ -91,7 +91,6 @@ files:
91
91
  - README.md
92
92
  - lib/scopy.rb
93
93
  - lib/scopy/created_at_scopes.rb
94
- - lib/scopy/id_scopes.rb
95
94
  - lib/scopy/name_scopes.rb
96
95
  - lib/scopy/version.rb
97
96
  homepage: https://github.com/neighborland/scopy
@@ -1,14 +0,0 @@
1
- module Scopy
2
- module IdScopes
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- # objects may be:
7
- # one id
8
- # an array of ids
9
- # one model
10
- # a relation or array of models
11
- scope :excluding, -> (objects) { where.not(id: Array.wrap(objects)) }
12
- end
13
- end
14
- end