frozen_record 0.20.0 → 0.20.1

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: 8f755e0e4bce41d9687a8b29eedad265593319156b8d086e81c355d6cdbf15dd
4
- data.tar.gz: bb63057b31078536220168e6430ee0099cad053bdfd35a1a2567c054fe26e780
3
+ metadata.gz: 4c98f13b693b4c7bceae48a308722c3681a678033855f40995a10fd82c0faee8
4
+ data.tar.gz: ff4ef784946b6fc9f067caf8e26d50433c3c396716ead1c953dd324528861ab2
5
5
  SHA512:
6
- metadata.gz: 22929e50f2c0eec95d863222171cf81ab52531396118259ff4107240d5ce7d9828f70198b133a126bedb0f11cea7858814ab1fdabbcf31e9840aaad23cb9c614
7
- data.tar.gz: 43c61d4238b44945bcd94bea89864ba0c4a06d0b53669e9a27d00ae2ba27673817ef5104c710e341c0ed286d544195f3a7615bac306c6cc8424c5afd0453a921
6
+ metadata.gz: e25090babf81d5ffa18a26acecf5af68d3424866b848508838ded880196d2178f994ce586be9bee8d63db71b3c84159ed2b4fac2c7e90f26414b9fbff4c69598
7
+ data.tar.gz: 384749f211db239a1d3964c16d5c23d4af4261ee052d6c0fa16f15f0d6a0ce5710df898b1f4e290c9cfa77c553d214668ab383ca33b09fbb82a03266db7a0324
@@ -227,6 +227,7 @@ module FrozenRecord
227
227
  super
228
228
  end
229
229
  end
230
+ ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
230
231
 
231
232
  def delegate_to_class(*args, &block)
232
233
  scoping { @klass.public_send(*args, &block) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FrozenRecord
4
- VERSION = '0.20.0'
4
+ VERSION = '0.20.1'
5
5
  end
@@ -193,6 +193,11 @@ describe 'querying' do
193
193
  expect(countries.length).to be == 0
194
194
  end
195
195
 
196
+ it 'is chainable with methods of the form `def method(*args, **kargs)' do
197
+ countries = Country.republics.continent_and_capital('Europe', capital: 'Paris')
198
+ expect(countries.length).to be == 1
199
+ end
200
+
196
201
  it 'can be used with arrays' do
197
202
  countries = Country.where(id: [1,2])
198
203
  expect(countries.length).to be == 2
@@ -12,6 +12,10 @@ class Country < FrozenRecord::Base
12
12
  where(nato: true)
13
13
  end
14
14
 
15
+ def self.continent_and_capital(continent, capital:)
16
+ where(continent: continent, capital: capital)
17
+ end
18
+
15
19
  def reverse_name
16
20
  name.reverse
17
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frozen_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.0.2
171
+ rubygems_version: 3.1.2
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: ActiveRecord like interface to read only access and query static YAML files