frozen_record 0.21.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b998592ed0453f220a0679b3ee2aea49d1d5381a3a7c4d6e9286434e6e3b6c27
4
- data.tar.gz: 3f430857f5b5626951360d2c28402c58b5751cb1ef2805f139558d600b7e1e1c
3
+ metadata.gz: 0a25a269067396d2e6054a57c514b1251e39dca90928e7bdd837bfbb9ef8d2cf
4
+ data.tar.gz: 77b55ee24e39590dd213c157b22e3707c8f551a051df34f516a1e9d061d4eb6a
5
5
  SHA512:
6
- metadata.gz: cbc8307030df2b393d69499c7be236ef62349ad6f74b7fc9de914260748fd0919e293204b30ba31e377acf157acb90e9371d4ed50a77da955f60222694f74892
7
- data.tar.gz: f211b9298137e71e098e841658341f0cceb3dd902f7974a5a9a7c2233173bd1016037832ba744f8966beb9045fa9c93068365ad5d9b7d64f9b68631e1b840ca1
6
+ metadata.gz: a1d23916d54278598ec3ba29e5c1000f4adb0f13566db9be7900e5344199e36fe02254539a531a26d8b2d211e62f3916438c98032e7166795fbbf1681a170b91
7
+ data.tar.gz: af66cb72d621f8d6008de238d7f0846bf576200437fbdead4cfcdd1d598af62ac4d29bd801efd14420bfddb4470301312eb992628e2c7185e21b8dbee0381f6e
@@ -8,7 +8,8 @@ jobs:
8
8
  strategy:
9
9
  matrix:
10
10
  ruby: [ '2.5', '2.6', '2.7', '3.0' ]
11
- name: Ruby ${{ matrix.ruby }} tests
11
+ minimal: [ false, true ]
12
+ name: Ruby ${{ matrix.ruby }} tests, minimal=${{ matrix.minimal }}
12
13
  steps:
13
14
  - uses: actions/checkout@v2
14
15
  - name: Setup Ruby
@@ -26,4 +27,6 @@ jobs:
26
27
  gem install bundler
27
28
  bundle install --jobs 4 --retry 3 --path=vendor/bundle
28
29
  - name: Run tests
30
+ env:
31
+ MINIMAL: ${{ matrix.minimal }}
29
32
  run: bundle exec rake
@@ -239,7 +239,7 @@ module FrozenRecord
239
239
  private
240
240
 
241
241
  def attribute?(attribute_name)
242
- FALSY_VALUES.exclude?(self[attribute_name]) && self[attribute_name].present?
242
+ !FALSY_VALUES.include?(self[attribute_name]) && self[attribute_name].present?
243
243
  end
244
244
 
245
245
  def attribute_method?(attribute_name)
@@ -74,7 +74,7 @@ module FrozenRecord
74
74
 
75
75
  def attribute?(attribute_name)
76
76
  val = self[attribute_name]
77
- Base::FALSY_VALUES.exclude?(val) && val.present?
77
+ !Base::FALSY_VALUES.include?(val) && val.present?
78
78
  end
79
79
  end
80
80
  end
@@ -234,7 +234,7 @@ module FrozenRecord
234
234
  end
235
235
 
236
236
  def array_delegable?(method)
237
- Array.method_defined?(method) && DISALLOWED_ARRAY_METHODS.exclude?(method)
237
+ Array.method_defined?(method) && !DISALLOWED_ARRAY_METHODS.include?(method)
238
238
  end
239
239
 
240
240
  def where!(criterias)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FrozenRecord
4
- VERSION = '0.21.0'
4
+ VERSION = '0.21.1'
5
5
  end
@@ -415,7 +415,7 @@ describe 'querying' do
415
415
 
416
416
  end
417
417
 
418
- describe '.as_json' do
418
+ describe '.as_json', exclude_minimal: true do
419
419
 
420
420
  it 'serialize the results' do
421
421
  json = Country.all.as_json
@@ -1,6 +1,8 @@
1
1
  lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
+ minimal = ENV['MINIMAL'] == 'true'
5
+
4
6
  require 'pry'
5
7
  require 'simplecov'
6
8
  require 'coveralls'
@@ -11,7 +13,13 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
11
13
  SimpleCov.start
12
14
 
13
15
  require 'objspace'
14
- require 'frozen_record'
16
+
17
+ if minimal
18
+ require 'frozen_record/minimal'
19
+ else
20
+ require 'frozen_record'
21
+ end
22
+
15
23
  require 'frozen_record/test_helper'
16
24
 
17
25
  FrozenRecord::Base.base_path = File.join(File.dirname(__FILE__), 'fixtures')
@@ -23,6 +31,7 @@ FrozenRecord.eager_load!
23
31
  RSpec.configure do |config|
24
32
  config.run_all_when_everything_filtered = true
25
33
  config.filter_run :focus
34
+ config.filter_run_excluding :exclude_minimal if minimal
26
35
 
27
36
  config.order = 'random'
28
37
 
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.21.0
4
+ version: 0.21.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: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel