where_chain 0.2.5 → 0.3

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: bd39311e12bdfa313174e8b959a7d49b1b859826f62e9fc863182e9b708e9f43
4
- data.tar.gz: e4d754808fe88755535d0ab3757bc42b894412e5c779514149c5b836dbae3882
3
+ metadata.gz: ef53c9e5f529286b2d2faf6c0dc9e722e64b0577655c5d8a01f5288f8aa87e5f
4
+ data.tar.gz: 7486f23189d27b235993b6284396d011f167df9424ab09368515995a36c82831
5
5
  SHA512:
6
- metadata.gz: 6609b78eb90f918ea3950ada6d6798bc3c9e16f09cfbbe59055907df71f418aa39f621ccd685d8147db7b201efaba815663fbb47c06936d8a59292274a94eea7
7
- data.tar.gz: 34e86eb4d8720df5b4a3bd06419441c197b6bb04c67968de76c9a75dbbeda848794befdaf4c59903baad561718c10900650c351c498707d69d5e7ebc0c51a46f
6
+ metadata.gz: 327bd859b122cfe58dc0856a6950fb5acb7cebc2330404934cea36d5bf12e2ecb6e56691c99094b9f97329e08d7e93b05b7ab34da1fec10c336315803c7ae148
7
+ data.tar.gz: ec6bf55904a564981a2b9d81559dc011ed9794705e9c99d6faed743682419ab583ef8a8e2b57e384e4dd656337a5fae856488f28d96ed62ddb9bde47afbb3cbb
data/README.md CHANGED
@@ -6,11 +6,11 @@ In Rails, we usually use Active Record, which allows us to escape from writing S
6
6
 
7
7
  In the older versions, you also had to write `Post.where('name IS NOT null')` to do a negation. Rails 4.0 added a class called `WhereChain` that added some [new possibilities](https://github.com/rails/rails/commit/de75af7acc5c05c708443de40e78965925165217), one of which was a `not` method. The proper way to write became `Post.where.not(name: nil)` instead.
8
8
 
9
- Within the same comment there were also two new methods that [didn't survive to the release of Rails 4.0](https://github.com/rails/rails/commit/8d02afeaee8993bd0fde69687fdd9bf30921e805) - `.like` and `.not_like`. As you can read in this commit discussion, there has been work made to bring them back, like the [activerecord-like](https://github.com/ReneB/activerecord-like) gem or [Squeel](https://github.com/activerecord-hackery/squeel), but these has their own problems - activerecord-like only adds `.like` and `.not_like` back and the latest version is locked to Active Record 5; and Squeel provides a whole new query DSL, which not everyone will like. There was actually a pull request adding `.gt` and other [inequality methods](https://github.com/rails/rails/pull/8453), which was closed even faster than the first one.
9
+ Within the same commit there were also two new methods that [didn't survive to the release of Rails 4.0](https://github.com/rails/rails/commit/8d02afeaee8993bd0fde69687fdd9bf30921e805) - `.like` and `.not_like`. As you can read in this commit discussion, there has been work made to bring them back, like the [activerecord-like](https://github.com/ReneB/activerecord-like) gem or [Squeel](https://github.com/activerecord-hackery/squeel), but these has their own problems - activerecord-like only adds `.like` and `.not_like` back and the latest version is locked to Active Record 5; and Squeel provides a whole new query DSL, which not everyone will like. There was actually a pull request adding `.gt` and other [inequality methods](https://github.com/rails/rails/pull/8453), which was closed even faster than the first one.
10
10
 
11
11
  This gem brings these two methods back and extends WhereChain with additional methods: `.gt`, `.gte`, `.lt` and `.lte`, so that by using it you can replace the SQL strings like `Post.where('comments > 5')` with `Post.where.gt(comments: 5)`.
12
12
 
13
- WhereChain depends on the Active Record gem in a version higher than 4.2, due to problems with Ruby versions lesser than 2.4. Rails 4.2 is already the version that's being maintained, so you probably should not use an earlier one anyway. The gem is tested on the latest Ruby and all current Rails versions - 4.2, 5.0, 5.1 and 5.2.
13
+ WhereChain depends on the Active Record gem in a version higher than 4.2, due to problems with Ruby versions lesser than 2.4. Rails 4.2 is already the version that's being maintained, so you probably should not use an earlier one anyway. The gem is tested on the latest Ruby and all current Rails versions - 4.2, 5.0, 5.1, 5.2 and 6.0.
14
14
 
15
15
  ## Usage
16
16
 
@@ -5,6 +5,6 @@ require 'active_record/where_chain_shared_methods'
5
5
  # Active Record changed a lot in Rails 5 and 4 is still supported
6
6
  if ActiveRecord::VERSION::MAJOR == 4
7
7
  require 'active_record/where_chain_extensions_rails4'
8
- elsif ActiveRecord::VERSION::MAJOR == 5
8
+ elsif ActiveRecord::VERSION::MAJOR == 5 || ActiveRecord::VERSION::MAJOR == 6
9
9
  require 'active_record/where_chain_extensions_rails5'
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhereChain
4
- VERSION = '0.2.5'
4
+ VERSION = '0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: where_chain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Ruszkiewicz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord