parascope 1.0.1 → 1.0.2

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: 3195e544c77f3024607110d86b36783250643f85
4
- data.tar.gz: 22d0aaf9e030c782dd1cd5bcae862dc59642918c
3
+ metadata.gz: 148749dbca46560b2b152377b8095d27fec8a1a1
4
+ data.tar.gz: a449da808e60361c33b60b4ba524f272a5b83173
5
5
  SHA512:
6
- metadata.gz: 7a95450b4483a64760710e5bd5bfcec52730b7c5b523097080a94a41ad33dcd4dd2c2bda9673294c91cf9139ad2012de9710d01d9118c3a0dae72eff3d3465a1
7
- data.tar.gz: fd83e9f6f76a1e8396621621898cac2ab10f1adeed9f2a352d97afe7f10014b1cdae1512df9faa9df25e66871582fc84a5a7c23e1bc1d008b2b7ed3f53acd6e0
6
+ metadata.gz: 9f876d869db3495232e67154fa0bcdb6089f62cc855112deb986b019f6e112c2782cc0158ffd899a1139c095c2ee0bd602e55ee6d3b7557e663a67d9caf4413c
7
+ data.tar.gz: 000864ff20232cf0d0f85bc74f29febc476dfc6eb668324640962caed100578d7900cc2011b0790978d88be992eaaf80292ec729fdb7c5a46b2e17306eb9dcca
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  === master
2
2
 
3
+ === 1.0.2
4
+
5
+ Remove base_scope application on sifted instance
6
+
3
7
  === 1.0.1
4
8
 
5
9
  Fix base scope application on sifted instance
data/README.md CHANGED
@@ -306,6 +306,26 @@ query.project_users # => this is the same as:
306
306
  # .order("CONCAT(first_name, ' ', last_name) DESC")
307
307
  ```
308
308
 
309
+ ### A Note on `base_scope` Blocks
310
+
311
+ Keep in mind that _all_ `base_scope` blocks are
312
+ **applied only if query object was initialized without explicit scope option**,
313
+ i.e. if your Query class has a sifter with mandatory scope modification, and
314
+ you initialize your query objects with explicit scope, you most likely want
315
+ to use unoptional `query` block within sifter definition. For example,
316
+
317
+ ```rb
318
+ class MyQuery < Parascope::Query
319
+ sifter :with_projects do
320
+ query { scope.joins(:projects) }
321
+
322
+ # ...
323
+ end
324
+ end
325
+
326
+ query = MyQuery.new(params, scope: some_scope)
327
+ ```
328
+
309
329
  ### Hints and Tips
310
330
 
311
331
  - Keep in mind that query classes are just plain Ruby classes. All `sifter`,
@@ -96,9 +96,6 @@ module Parascope
96
96
  singleton_class.instance_exec(*block.values_for(params), &block.block)
97
97
  end
98
98
  params.replace(singleton_class.defaults.merge(params))
99
- if instance_variable_defined?('@scope') && !singleton_class.base_scope.nil?
100
- @scope = instance_exec(@scope, &singleton_class.base_scope)
101
- end
102
99
  @sifted = true
103
100
  end
104
101
 
@@ -1,3 +1,3 @@
1
1
  module Parascope
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parascope
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Kuzko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie