wharel 0.4.0 → 0.5.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: a3c803c1e0aa9c250d629af479b9ccbc85c615654d5b3cd3ea1090a519f3a883
4
- data.tar.gz: 183364f83c7f226c02ab2d2498dbe0caa429cb684c2c1ca9180d689e33245832
3
+ metadata.gz: 88276994d910f1ad92e85cba73bd2af743e8a6c9f248cd77cbd0ebe65050a2ac
4
+ data.tar.gz: f5b28c448a8f80166f9448d7e1004256f9a1fbe4ec4e52decbc7c653df51c60d
5
5
  SHA512:
6
- metadata.gz: e9890716f4e44c82a5e8df2dea4d29987dc7ae21ad1ea20802ae53ccaf47b1be453309ac221335d1433677ba8b3e2366351cc721a7689e1b339741114ac38991
7
- data.tar.gz: 3341d125908a27b82f70bbbc7626adb4621c37d9bf69fb272a93b32e434772fb9e8132284d79e0730af3c61a0b9f057353b994a484264311f304009a414af523
6
+ metadata.gz: 2850a9007cdd84e67c25093139eb101946c1c43c6bdce4afb8b16366bee4d3ec9a618e2be41f951fb5e098676f0e3d6effbd69982bb686bfd38d4bca78515073
7
+ data.tar.gz: 5ea4564b5db3dc12cb5aee1d1d5a6ce4510e0a705787c0ac2cd5464153700de3e67d22db5d36b40768fed1d83c5588d1b7b026810749102ee5b19642cc600a1b
@@ -1,5 +1,11 @@
1
1
  # Wharel Changelog
2
2
 
3
+ ## 0.5 (February 11, 2020)
4
+
5
+ - Add Rails 6 support, `pick`, `select`
6
+ ([#9](https://github.com/shioyama/wharel/pull/9), thanks
7
+ [f-mer](https://github.com/f-mer)!)
8
+
3
9
  ## 0.4
4
10
 
5
11
  ### 0.4.0 (November 2, 2019)
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wharel (0.3.0)
5
- activerecord (>= 5, <= 6)
4
+ wharel (0.5.0)
5
+ activerecord (>= 5, <= 6.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -28,7 +28,7 @@ post](https://dejimata.com/2018/5/30/arel-with-wharel).
28
28
  Add this line to your application's Gemfile:
29
29
 
30
30
  ```ruby
31
- gem 'wharel', '~> 0.4.0'
31
+ gem 'wharel', '~> 0.5.0'
32
32
  ```
33
33
 
34
34
  And then execute:
@@ -82,7 +82,7 @@ Post.where.not { title.eq("foo") }
82
82
  Post.order { title.lower }
83
83
  ```
84
84
 
85
- Wharel also supports `having`, `pluck`, `group` and `or` in the same way.
85
+ Wharel also supports `select`, `having`, `pluck`, `pick`, `group` and `or` in the same way.
86
86
 
87
87
  Now suppose we have another model `Comment` with a column `content`, and a
88
88
  `Post` `has_many :comments`:
@@ -3,10 +3,12 @@ require "active_record"
3
3
 
4
4
  module Wharel
5
5
  module QueryMethods
6
- %w[where order having pluck group].each do |method_name|
6
+ %w[select where order having pluck pick group].each do |method_name|
7
+ next unless ::ActiveRecord::Base.singleton_class.method_defined?(method_name)
8
+
7
9
  module_eval <<-EOM, __FILE__, __LINE__ + 1
8
10
  def #{method_name}(*, &block)
9
- block_given? ? super(VirtualRow.build_query(self, &block)) : super
11
+ block_given? ? super(VirtualRow.build_query(self, &block), &nil) : super
10
12
  end
11
13
  EOM
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module Wharel
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wharel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-02 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5'
20
20
  - - "<="
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5'
30
30
  - - "<="
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement