normalizr 0.5.0 → 0.6.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: 6df1b6a2804509540eacc96b2df9fd1a35ef129f64e88d672bdad2361dd92513
4
- data.tar.gz: 46d9326603da3d5741c9174e7a579c1cc994463cdbafaeeabd13fd4bff6002d4
3
+ metadata.gz: 071f5233a61eca74bcc0cf721bb21438c4d3fe4ecf1f6c798d3bf6ed42cac726
4
+ data.tar.gz: 251c887f7329e9948679b9418f525790d97863daa815065f3cb85eb4fe722014
5
5
  SHA512:
6
- metadata.gz: b01d5e605d9b743a6763d68f00a14e61f70314c7f666ddc628cb1930c49acabf5faf85c2f0cccb8f5652b706f9dc6a158723e027352c792ced274338e7f946cb
7
- data.tar.gz: 2a2501d6aca9ea1b4afdfd5b1d976b1c16cae4e285bf2f6d8cd2b143a69619d680a7b48e2c3b958810e8f057316718c91b5493d13a2fee89b1958e6202efa5e5
6
+ metadata.gz: d1bcc6d23dd83744c97dadcf8b5087f8d63645554bb76b7a305b71fd99350134116c773e417856210d2b0a874959d933c023d2ac7066e6207e8674cb5dd7c696
7
+ data.tar.gz: 22ccaffe54bb4d7786a9f383f4cc0adcde679e64bc8de4b09ecfc32f902f14fe2692e70bd28e111af36685f63fc9ef28739423b4e91883ef0c087d7a486a1513
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: RSpec
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - main
11
+
12
+ jobs:
13
+ rspec:
14
+ runs-on: ubuntu-latest
15
+
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby-version:
20
+ - '2.7'
21
+ - '3.0'
22
+ - '3.1'
23
+ - '3.2'
24
+ gemfile:
25
+ - activerecord-5.2.x
26
+ - activerecord-6.0.x
27
+ - activerecord-6.1.x
28
+ - activerecord-7.0.x
29
+ exclude:
30
+ - ruby-version: '3.0'
31
+ gemfile: activerecord-5.2.x
32
+ - ruby-version: '3.1'
33
+ gemfile: activerecord-5.2.x
34
+ - ruby-version: '3.2'
35
+ gemfile: activerecord-5.2.x
36
+ - ruby-version: '3.0'
37
+ gemfile: activerecord-6.0.x
38
+ - ruby-version: '3.1'
39
+ gemfile: activerecord-6.0.x
40
+ - ruby-version: '3.2'
41
+ gemfile: activerecord-6.0.x
42
+
43
+ env:
44
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
45
+
46
+ steps:
47
+ - name: Checkout
48
+ uses: actions/checkout@v3
49
+
50
+ - name: Set up Ruby
51
+ uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: ${{ matrix.ruby-version }}
54
+ bundler-cache: true
55
+
56
+ - name: Run RSpec
57
+ run: bundle exec rake
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 0.6.1 / 2023-02-21
2
+
3
+ * Support pass through multiple arguments in assignment operator (@cbillen)
4
+ * Move to Github Actions
5
+
6
+ ### 0.6.0 / 2021-07-29
7
+
8
+ * Use on_load hook for integration with ActiveRecord (@sikachu)
9
+ * Use update instead of update_attributes (@sikachu)
10
+
1
11
  ### 0.5.0 / 2020-07-27
2
12
 
3
13
  * Add ability to use default and custom normalizers together (@subbbotin)
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## Normalizr
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/normalizr.svg)](https://badge.fury.io/rb/normalizr)
4
- [![Build Status](https://travis-ci.org/dmeremyanin/normalizr.svg?branch=master)](https://travis-ci.org/dmeremyanin/normalizr)
4
+ [![Build Status](https://github.com/dmeremyanin/normalizr/actions/workflows/rspec.yml/badge.svg?branch=main)](https://github.com/dmeremyanin/normalizr/actions/workflows/rspec.yml)
5
5
  [![Code Climate](https://codeclimate.com/github/dmeremyanin/normalizr/badges/gpa.svg)](https://codeclimate.com/github/dmeremyanin/normalizr)
6
6
  [![Test Coverage](https://codeclimate.com/github/dmeremyanin/normalizr/badges/coverage.svg)](https://codeclimate.com/github/dmeremyanin/normalizr/coverage)
7
7
 
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~> 6.1.0'
4
+ gem 'mongoid', '~> 7.0'
5
+ gem 'codeclimate-test-reporter', require: false
6
+
7
+ gemspec path: '../'
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~> 7.0.0'
4
+ gem 'mongoid', '~> 8.0'
5
+ gem 'codeclimate-test-reporter', require: false
6
+
7
+ gemspec path: '../'
@@ -10,7 +10,7 @@ module Normalizr
10
10
 
11
11
  prepend Module.new {
12
12
  options.attributes.each do |method|
13
- define_method :"#{method}=" do |value|
13
+ define_method :"#{method}=" do |value, *method_args|
14
14
  condition_lambda = -> condition { Proc === condition ? instance_exec(&condition) : send(condition) }
15
15
 
16
16
  positive = options.positive_condition.all?(&condition_lambda)
@@ -21,7 +21,7 @@ module Normalizr
21
21
  value = Normalizr.normalize(value, *options.after) if options.after.any?
22
22
  end
23
23
 
24
- super(value)
24
+ super(value, *method_args)
25
25
  end
26
26
  end
27
27
  }
@@ -1 +1,3 @@
1
- ActiveRecord::Base.send(:include, Normalizr::Concern)
1
+ ActiveSupport.on_load(:active_record) do
2
+ include Normalizr::Concern
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Normalizr
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.1'
3
3
  end
data/normalizr.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'normalizr/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'normalizr'
7
7
  spec.version = Normalizr::VERSION
8
- spec.authors = ['Dimko']
8
+ spec.authors = ['Dmitriy Meremyanin']
9
9
  spec.email = ['deemox@gmail.com']
10
10
  spec.description = 'Writer methods parameters normalization'
11
11
  spec.summary = 'Writer methods parameters normalization'
@@ -21,7 +21,7 @@ describe Article do
21
21
  before do
22
22
  @article = Article.create!(title: 'Original Title')
23
23
  @article2 = Article.find(@article.id)
24
- @article2.update_attributes(title: 'New Title')
24
+ @article2.update(title: 'New Title')
25
25
  end
26
26
 
27
27
  it "should reflect the change when the record is reloaded" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: normalizr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
- - Dimko
7
+ - Dmitriy Meremyanin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2023-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -143,9 +143,10 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
+ - ".github/workflows/rspec.yml"
146
147
  - ".gitignore"
147
148
  - ".rspec"
148
- - ".travis.yml"
149
+ - ".tool-versions"
149
150
  - CHANGELOG.md
150
151
  - Gemfile
151
152
  - LICENSE.txt
@@ -153,6 +154,8 @@ files:
153
154
  - Rakefile
154
155
  - gemfiles/activerecord-5.2.x.gemfile
155
156
  - gemfiles/activerecord-6.0.x.gemfile
157
+ - gemfiles/activerecord-6.1.x.gemfile
158
+ - gemfiles/activerecord-7.0.x.gemfile
156
159
  - lib/normalizr.rb
157
160
  - lib/normalizr/concern.rb
158
161
  - lib/normalizr/configuration.rb
@@ -210,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
213
  - !ruby/object:Gem::Version
211
214
  version: '0'
212
215
  requirements: []
213
- rubygems_version: 3.0.8
216
+ rubygems_version: 3.1.6
214
217
  signing_key:
215
218
  specification_version: 4
216
219
  summary: Writer methods parameters normalization
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.5.7
5
- - 2.6.5
6
- - 2.7.0
7
- gemfile:
8
- - gemfiles/activerecord-5.2.x.gemfile
9
- - gemfiles/activerecord-6.0.x.gemfile
10
- addons:
11
- code_climate:
12
- repo_token:
13
- secure: Dn+nXUOFHTRUhYqYM1NYSxYSyoDhFaB2EHvlhBJ/FK3QxCy4a0beSLhs+YnDl8kI1DOrZQMl7HDrh9AHlfYvu5fX4zADD5g7JkTA2mIx1Rk3yazAUuy1j1ftX/UaowzoUAR5t0qwYm344Nnqoh+O1FujvWbiGVuZvWa6vfjFbXA=
14
- matrix:
15
- fast_finish: true
16
- before_install:
17
- - gem install bundler
18
- sudo: false