blueprinter-rb 1.1.2 → 1.2.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: ee4575fe04c30d5bfe90eddbb32fc2e9ffbea173784ff5275e8f7f9a0e474499
4
- data.tar.gz: c830deadf21f28b06a68cf26a822e44fe23f2045c7312b935167a477852afc87
3
+ metadata.gz: e0c11b02470f7704449b1aba7833ced1bba7a33d16faf0becacf9d4da49d8036
4
+ data.tar.gz: c58f725526c7e4c3a58b396c90a95758a166093b4dccddcdcef349d5ebceebc0
5
5
  SHA512:
6
- metadata.gz: 576546159d1566b013b048f53cb136f1f61f2ee0ff7795b30a7e52e859e3a78c983312a94f0f861a86cdce191378011fa1e1da691d086d7b30d5134e101b2670
7
- data.tar.gz: 007a03a98cc4f469c3a8fce4b462bbf14521998303b58f0c3228ca8e81b06f841370a0ae776637da6f0d9212dc5f081e2645a8d83cedd3ab28407cfc62dc331f
6
+ metadata.gz: 0beefb4966398bc05767181f03e3388066a34193ad3ea9af8703cd58af3bac1edad9dba946132a7d659bbe87d387df8d93eb81b0635ed882ab5b172e3a9160e4
7
+ data.tar.gz: 95f1e8e862f7801b335182a448ca6bee2f7af4813e3c6b910084939d69c1d8f1bcdb15d85a043c9ae12e5f73fcd2ea40f04336b3d8942ba591fb89c18afa40d9
data/README.md CHANGED
@@ -453,9 +453,9 @@ class UserBlueprint < Blueprinter::Base
453
453
 
454
454
  view :normal do
455
455
  # If first_name is an empty string, it will become "N/A"
456
- field :first_name, default_if: Blueprinter::EmptyString, default: "N/A"
456
+ field :first_name, default_if: Blueprinter::EMPTY_STRING, default: "N/A"
457
457
  # If the projects association collection is empty, it will become nil
458
- association :projects, blueprint: ProjectBlueprint, default_if: Blueprinter::EmptyCollection
458
+ association :projects, blueprint: ProjectBlueprint, default_if: Blueprinter::EMPTY_COLLECTION
459
459
  end
460
460
  end
461
461
  ```
@@ -954,7 +954,7 @@ $ bundle
954
954
 
955
955
  Or install it yourself as:
956
956
  ```bash
957
- $ gem install blueprinter
957
+ $ gem install blueprinter-rb
958
958
  ```
959
959
 
960
960
  You should also have `require 'json'` already in your project if you are not using Rails or if you are not using Oj.
@@ -22,11 +22,6 @@ module Blueprinter
22
22
  value.is_a?(Hash) && value.empty?
23
23
  when Blueprinter::EMPTY_STRING
24
24
  value.to_s == ''
25
- else
26
- Blueprinter::Deprecation.report(
27
- "Invalid empty type '#{empty_type}' received. Blueprinter will raise an error in the next major version." \
28
- 'Must be one of [nil, Blueprinter::EMPTY_COLLECTION, Blueprinter::EMPTY_HASH, Blueprinter::EMPTY_STRING]'
29
- )
30
25
  end
31
26
  end
32
27
  end
@@ -38,17 +38,6 @@ module Blueprinter
38
38
  end
39
39
 
40
40
  def callable_from(condition)
41
- callable = old_callable_from(condition)
42
-
43
- if callable && callable.arity == 2
44
- Blueprinter::Deprecation.report("`:#{condition}` conditions now expects 3 arguments instead of 2.")
45
- ->(_field_name, obj, options) { callable.call(obj, options) }
46
- else
47
- callable
48
- end
49
- end
50
-
51
- def old_callable_from(condition)
52
41
  config = Blueprinter.configuration
53
42
 
54
43
  # Use field-level callable, or when not defined, try global callable
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blueprinter
4
- VERSION = '1.1.2'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueprinter-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ritikesh G
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-06 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: oj
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.13'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '3.13'
27
- - !ruby/object:Gem::Dependency
28
- name: yajl-ruby
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.4'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.4'
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
+ dependencies: []
41
13
  description: Blueprinter is a JSON Object Presenter for Ruby that takes business objects
42
14
  and breaksthem down into simple hashes and serializes them to JSON. It can be used
43
15
  in Rails in place of otherserializers (like JBuilder or ActiveModelSerializers).