dekorator 1.3.0 → 1.4.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: 65b1b1e3eab54d74eb9ac8a975bd21b685cebe43ad26e96c39695731176de03d
4
- data.tar.gz: 89311b6a6b7c9319994c85e62bee7a58034bd97c3598b30fb3026304f8e317f5
3
+ metadata.gz: 3be52de1bc12b28c6d1ff4bea939372bbfb0a5301ad86af2250fc30978e48ac4
4
+ data.tar.gz: 360e06d0304088cc04b27d55b7acbd2b69bb91b603c7c2cd2d4710bd59251ce6
5
5
  SHA512:
6
- metadata.gz: bb081f14a84f51bec57c5a6625cdfed0cffc48d0a8c88a83ab40a828a5a0e5bab4eba62710bd82a22a42e56c0601332da250d8f2c61f2d8af87be2d948fa674d
7
- data.tar.gz: c7aa2f27e8e85ed0b2d4c615967478a8fe795e9f30be92378c1b6ab29a63c4576c55ef1555f081014e819734e43041a80416a82c5e5386fc666ffc4f7d9bcb36
6
+ metadata.gz: f468d2ebc35a90ee863d463f925bd5c973e4f578faefaa7da7e7a16bba65672053f51abcf2a8dc182870797b5c21269393a9003fa25f041eb54914bced188b17
7
+ data.tar.gz: cb2ade4a911a421eb53affa54b8b7c2133f8dd13c47985c7e4269d345fd543c437e2b8ecf58753ff3f78e80acc93a5af59b5556008e2dc38c3b2b3af5880d136
data/CHANGELOG.md CHANGED
@@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
- Nothing yet
9
+ Nothing yet.
10
+
11
+ ## [1.4.0] - 2023-11-09
12
+ ### Changed
13
+ - ⚠️ **Breaking** `.decorates_association` now generate `#decorated_[ASSOCIATION_NAME]` instead `#[ASSOCIATION_NAME]` ([#48](https://github.com/komposable/dekorator/pull/48))
10
14
 
11
15
  ## [1.3.0] - 2023-11-06
12
16
  ### Added
@@ -17,6 +21,7 @@ Nothing yet
17
21
  - Remove Coveralls usage ([#47](https://github.com/komposable/dekorator/pull/47))
18
22
 
19
23
  ## [1.2.1] - 2021-10-14
24
+ ### Changed
20
25
  - Make decorated `Enumerable` not lazy anymore ([#46](https://github.com/komposable/dekorator/pull/46))
21
26
 
22
27
  ## [1.2.0] - 2021-10-14
@@ -57,7 +62,8 @@ Nothing yet
57
62
  - Create `dekorator:install` generator ([a2a36d66](https://github.com/komposable/dekorator/commit/a2a36d66c6de6cb0a00f783794cd29f899bc04b6))
58
63
  - Create `decorator` generator ([a2a36d66](https://github.com/komposable/dekorator/commit/a2a36d66c6de6cb0a00f783794cd29f899bc04b6))
59
64
 
60
- [Unreleased]: https://github.com/komposable/dekorator/compare/v1.3.0...main
65
+ [Unreleased]: https://github.com/komposable/dekorator/compare/v1.4.0...main
66
+ [1.4.0]: https://github.com/komposable/dekorator/compare/v1.3.0...v1.4.0
61
67
  [1.3.0]: https://github.com/komposable/dekorator/compare/v1.2.1...v1.3.0
62
68
  [1.2.1]: https://github.com/komposable/dekorator/compare/v1.2.0...v1.2.1
63
69
  [1.2.0]: https://github.com/komposable/dekorator/compare/v1.1.0...v1.2.0
data/README.md CHANGED
@@ -108,12 +108,12 @@ class PostDecorator < ApplicationDecorator
108
108
  end
109
109
  ```
110
110
 
111
- In this example, `UserDecorator#posts` will be decorated.
111
+ In this example, `UserDecorator#posts` will be decorated as `#decorated_posts`.
112
112
 
113
113
  ```ruby
114
114
  decorated_user = decorate(User.first)
115
115
  decorated_user # => UserDecorator
116
- decorated_user.posts.first # => PostDecorator
116
+ decorated_user.decorated_posts.first # => PostDecorator
117
117
  ```
118
118
 
119
119
  ### Custom decorator
@@ -148,31 +148,11 @@ end
148
148
 
149
149
  decorated_user = decorate(User.first)
150
150
  decorated_user # => UserDecorator
151
- decorated_user.posts.first # => ArticleDecorator
151
+ decorated_user.decorated_posts.first # => ArticleDecorator
152
152
  ```
153
153
 
154
154
  ## Compatibility
155
155
 
156
- ### ActiveAdmin
157
-
158
- This gem is compatible with [`activeadmin`][activeadmin] ([2.8+](https://github.com/activeadmin/activeadmin/pull/6249)).
159
- For `activeadmin` before `2.8`, use `dekorator` `1.0.*`.
160
-
161
- Simply use `#decorate_with`
162
-
163
- ```ruby
164
- # app/admin/post.rb
165
- ActiveAdmin.register Post do
166
- decorate_with PostDecorator
167
-
168
- index do
169
- column :title
170
- column :image
171
- actions
172
- end
173
- end
174
- ```
175
-
176
156
  ### Devise
177
157
 
178
158
  If you use the [`Devise`][devise] gem you may have an issue if you decorate your
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dekorator
4
- VERSION = "1.3.0".freeze
4
+ VERSION = "1.4.0".freeze
5
5
  end
data/lib/dekorator.rb CHANGED
@@ -54,7 +54,7 @@ module Dekorator
54
54
  def decorates_association(relation_name, with: :__guess__)
55
55
  relation_name = relation_name.to_sym
56
56
 
57
- define_method(relation_name) do
57
+ define_method(:"decorated_#{relation_name}") do
58
58
  @_decorated_associations[relation_name] ||= decorate(__getobj__.public_send(relation_name), with: with)
59
59
  end
60
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dekorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pantographe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-06 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview