golden-objects 0.3.1 → 0.3.2

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: 4ad698392e6eec0c07e6dad7191d9e05de80cbbc748d89e4a4ade15abbc1268b
4
- data.tar.gz: 03015a5526edc2b9d9b8e7369b29c37693768baa323e0d596ad8b9bf134d0209
3
+ metadata.gz: 03a0e2d5404ea6f9b73f2a0db92ddbfe27c62ccd688a1884aeb5f941d9fc9588
4
+ data.tar.gz: 4fe38f49e3602b2a5a7b02e7cea73268262ef2885c123842b58b00d877b58d00
5
5
  SHA512:
6
- metadata.gz: 9ede8e78272efa09a5a0901b9f17ad797fcb52b88c7286ae374fe1cd737de4655496a829453ffe1879b12be4ae280ef039778875a590ae258b24d4a5fc209910
7
- data.tar.gz: d542dffaeae9c5f6825727de69621b50124d04b5a67eb0078502480077ded2ce3fd8bf3f7d9f4e1029d7c1411f2605a9deda028426a295b1f88d84042e6bf304
6
+ metadata.gz: 18fd434fedd9b088637bf830523d172ca17c42e65f68924e00aaec51fa233a1ade7c68c7b046f361f0ee483643e627d5be93f47936e60ec957839aecee9d5f92
7
+ data.tar.gz: '049714cb2f8fbc338d468d4144dabdcbf2504a12651995f9b535d4062eafb6512c5945b0bf41b74647e4a6ce19e736f293001c849b1603bc3ea56bcc1c747e4f'
@@ -1,5 +1,9 @@
1
1
  # Change Logs
2
2
 
3
+ ## v0.3.2
4
+
5
+ * Add `Golden::QueryRecordPresenter` and `Golden::QueryFormPresenter` as basic presenters.
6
+
3
7
  ## v0.3.1
4
8
 
5
9
  * The argement `presenter_class` of `Golden::QueryResultPresenter.collect` should be string instead of class.
@@ -21,8 +25,8 @@
21
25
 
22
26
  ## v0.2.0
23
27
 
24
- * Add golden form builder and helper
25
- * Golden query context support pluck
28
+ * Add golden form builder and helper.
29
+ * Golden query context support pluck.
26
30
 
27
31
  ## v0.1.0
28
32
 
@@ -26,7 +26,7 @@ module Golden
26
26
  define_method :record_presenter_class do
27
27
  return record_presenter.to_s.constantize if record_presenter.present?
28
28
 
29
- "#{self.class.parent.name}::RecordPresenter".constantize
29
+ "#{self.class.parent.name}::QueryRecordPresenter".constantize
30
30
  end
31
31
  end
32
32
  # rubocop:enable Naming/PredicateName
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Golden
4
+ class QueryFormPresenter < Golden::SingleFormPresenter
5
+ delegate :result, to: :form
6
+
7
+ def query_url
8
+ raise NotImplementedError
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Golden
4
+ class QueryRecordPresenter < Golden::ApplicationPresenter
5
+ class << self
6
+ def collect(records)
7
+ ::Golden::QueryResultPresenter.collect(records, name)
8
+ end
9
+ end
10
+
11
+ def initialize(record, accessors = {})
12
+ super(accessors)
13
+ @record = record
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module Golden
2
2
  module Objects
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: golden-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -101,6 +101,8 @@ files:
101
101
  - lib/golden/objects/query/query_context.rb
102
102
  - lib/golden/objects/query/query_form.rb
103
103
  - lib/golden/objects/query/query_form_operator.rb
104
+ - lib/golden/objects/query/query_form_presenter.rb
105
+ - lib/golden/objects/query/query_record_presenter.rb
104
106
  - lib/golden/objects/query/query_result_presenter.rb
105
107
  - lib/golden/objects/version.rb
106
108
  homepage: https://github.com/goldenio/golden-objects