power-types 0.6.0 → 0.7.0
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 +4 -4
- data/.circleci/config.yml +5 -5
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -0
- data/README.md +4 -4
- data/lib/power_types/patterns/presenter/base_presenter.rb +2 -2
- data/lib/power_types/util.rb +2 -1
- data/lib/power_types/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97911d46926a1215cd7a114d6a90f8e6716a9181f0551bed8f74b8ed8718ae84
|
4
|
+
data.tar.gz: 21ca06565fb213947fa263e1e07ebe89348641413ee9d05c566cdd09b697d994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4abc5333d3bdfb2a1f687c31a351894393191ce61806a31f58c54c3dcc561a65d86d8cd9cfdea85041b9d0f4bc091cd040b51fce8bdded07836046f653af460
|
7
|
+
data.tar.gz: 4e7a652ee31cca5e1fa70051f9934813300385a8fcfb96f29d2137cec4b38c9a6ab51b4e3026749923405dccff9a8c5c519c1fdcba1bed0b0843fbfa6a5b954b
|
data/.circleci/config.yml
CHANGED
@@ -14,10 +14,10 @@ executors:
|
|
14
14
|
parameters:
|
15
15
|
ruby-version:
|
16
16
|
description: "Ruby version"
|
17
|
-
default: "2
|
17
|
+
default: "3.2"
|
18
18
|
type: string
|
19
19
|
docker:
|
20
|
-
- image:
|
20
|
+
- image: cimg/ruby:<<parameters.ruby-version>>-node
|
21
21
|
environment: *env-vars
|
22
22
|
|
23
23
|
commands:
|
@@ -28,8 +28,8 @@ commands:
|
|
28
28
|
- run:
|
29
29
|
name: Install bundle dependencies
|
30
30
|
command: |
|
31
|
-
gem install bundler:2.2.
|
32
|
-
bundle install
|
31
|
+
gem install bundler:2.2.34
|
32
|
+
bundle _2.2.34_ install
|
33
33
|
|
34
34
|
jobs:
|
35
35
|
lint:
|
@@ -93,7 +93,7 @@ workflows:
|
|
93
93
|
- test:
|
94
94
|
matrix:
|
95
95
|
parameters:
|
96
|
-
ruby-version: ["2.5", "2.6", "2.7"]
|
96
|
+
ruby-version: ["2.5", "2.6", "2.7", "3.1", "3.2"]
|
97
97
|
- deploy:
|
98
98
|
context: org-global
|
99
99
|
filters:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2
|
1
|
+
3.2
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -257,7 +257,7 @@ end
|
|
257
257
|
```
|
258
258
|
Note: Triggering the event will preserve the order of the methods, so in the example `kill_villain` will be called before `bury_villains_corpse`.
|
259
259
|
|
260
|
-
Recently we added
|
260
|
+
Recently we added four new callbacks, `after_create_commit`, `after_update_commit`, `after_save_commit` and `after_destroy_commit`. With these callbacks we want to reproduce the `after_commit` transactional callback from Active Record. For this implementation we use the gem [After Commit Everywhere](https://github.com/Envek/after_commit_everywhere) to be able to use the `after_commit` callbacks outside the Active Record models.
|
261
261
|
|
262
262
|
### Values
|
263
263
|
|
@@ -296,7 +296,7 @@ To initialize a presenter inside your controller action you should execute the `
|
|
296
296
|
class UsersController < InheritedResources::Base
|
297
297
|
def show
|
298
298
|
presenter_params = { param1: 1, param2: 2 }
|
299
|
-
@presenter = present_with(:
|
299
|
+
@presenter = present_with(:users_show_presenter, presenter_params)
|
300
300
|
end
|
301
301
|
end
|
302
302
|
```
|
@@ -317,7 +317,7 @@ You can access `presenter_params` inside the presenter as an `attr_reader`
|
|
317
317
|
class UsersController < InheritedResources::Base
|
318
318
|
def show
|
319
319
|
presenter_params = { platanus_url: "https://platan.us" }
|
320
|
-
@presenter = present_with(:
|
320
|
+
@presenter = present_with(:users_show_presenter, presenter_params)
|
321
321
|
end
|
322
322
|
end
|
323
323
|
```
|
@@ -336,7 +336,7 @@ If the presenter param has a [decorator](https://github.com/drapergem/draper), t
|
|
336
336
|
class UsersController < InheritedResources::Base
|
337
337
|
def show
|
338
338
|
presenter_params = { user: user }
|
339
|
-
@presenter = present_with(:
|
339
|
+
@presenter = present_with(:users_show_presenter, presenter_params)
|
340
340
|
end
|
341
341
|
|
342
342
|
private
|
data/lib/power_types/util.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module PowerTypes
|
2
2
|
module Util
|
3
3
|
OBSERVABLE_EVENTS = [:create, :update, :save, :destroy]
|
4
|
-
OBSERVABLE_TRANSACTIONAL_EVENTS = [:create_commit, :update_commit, :save_commit
|
4
|
+
OBSERVABLE_TRANSACTIONAL_EVENTS = [:create_commit, :update_commit, :save_commit,
|
5
|
+
:destroy_commit]
|
5
6
|
OBSERVABLE_TYPES = [:before, :after]
|
6
7
|
end
|
7
8
|
end
|
data/lib/power_types/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignacio Baixas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -200,6 +200,7 @@ files:
|
|
200
200
|
- ".rspec"
|
201
201
|
- ".rubocop.yml"
|
202
202
|
- ".ruby-version"
|
203
|
+
- CHANGELOG.md
|
203
204
|
- CODE_OF_CONDUCT.md
|
204
205
|
- Gemfile
|
205
206
|
- Guardfile
|
@@ -255,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
256
|
- !ruby/object:Gem::Version
|
256
257
|
version: '0'
|
257
258
|
requirements: []
|
258
|
-
rubygems_version: 3.
|
259
|
+
rubygems_version: 3.4.10
|
259
260
|
signing_key:
|
260
261
|
specification_version: 4
|
261
262
|
summary: Power Types for Rails by Platanus
|