formalism-model_forms 0.8.0 → 0.9.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: cb6265733b776ca5782e1aba24dddc3c970757a89d9bb98471d98a920aa9a505
4
- data.tar.gz: c043043ca1857d578e7640048cd506bd4f8c6ed20e2105f8f0372e9f0a1d4b5e
3
+ metadata.gz: 47900b69f1be9c8bef86688c9e681826a65728c91c9845738783642743244b09
4
+ data.tar.gz: 4375669db4ec1759d39dc3997fae6093d1ae17b0b28e292f90fd564a3d24302d
5
5
  SHA512:
6
- metadata.gz: c5328cd192ef3378b687bb82a17aaa65665bbf021b10903ec232d032943e81068a9686695fc2976bd42301d2db48b4c75bf8f3e6e3c8e587528a8ba07574b1ac
7
- data.tar.gz: 5e06bbf7f096280a8b73ef6bd346529656c60d295082b49e5e9dc354b434e4b96c31c141afdcc7b8fef440a14efbb9dca804a1ec7dd221b364fee745124cae78
6
+ metadata.gz: ae16ac72bd4a0e9a2c7634fd714a8db54cebc7b4c4cdd271627a57ac82047d739947f1800b1eaa997c28473818ef86f3270be8f58415f2fe75b08f8a2237b12a
7
+ data.tar.gz: ceb502c64be7bde904b88824d76c2b78de639fa1cd7f818fddc128aedc699bf4c8828a799a3ddc01230bfd5c8fb5f956b323c9e67688f2c22d2b5c1bd0ab67b8
data/CHANGELOG.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## master (unreleased)
3
+ ## Unreleased
4
+
5
+ ## 0.9.0 (2022-09-21)
6
+
7
+ * Make `#instance=` public method.
8
+ * Drop Ruby 2.5 support.
9
+ * Add Ruby 3.1 for CI.
10
+ * Update development dependencies.
11
+ * Resolve RuboCop offenses.
4
12
 
5
13
  ## 0.8.0 (2021-02-11)
6
14
 
15
+ * Support Ruby 3.
16
+ * Update development dependencies.
17
+
7
18
  ## 0.7.2 (2020-11-11)
8
19
 
9
20
  * Fix error with `primary_field`.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Formalism Model Forms
2
2
 
3
3
  [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/formalism-model_forms?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/formalism-model_forms)
4
- [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/formalism-model_forms/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/formalism-model_forms)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/formalism-model_forms/main.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/formalism-model_forms)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/formalism-model_forms.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/formalism-model_forms)
6
6
  [![Depfu](https://img.shields.io/depfu/AlexWayfer/benchmark_toys?style=flat-square)](https://depfu.com/repos/github/AlexWayfer/formalism-model_forms)
7
- [![Inline docs](https://inch-ci.org/github/AlexWayfer/formalism-model_forms.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/formalism-model_forms)
7
+ [![Inline docs](https://inch-ci.org/github/AlexWayfer/formalism-model_forms.svg?branch=main)](https://inch-ci.org/github/AlexWayfer/formalism-model_forms)
8
8
  [![License](https://img.shields.io/github/license/AlexWayfer/formalism-model_forms.svg?style=flat-square)](LICENSE.txt)
9
9
  [![Gem](https://img.shields.io/gem/v/formalism-model_forms.svg?style=flat-square)](https://rubygems.org/gems/formalism-model_forms)
10
10
 
@@ -65,7 +65,7 @@ module Formalism
65
65
  end
66
66
 
67
67
  memoize def model_name
68
- deconstantize.split('::')[2..-1].reverse
68
+ deconstantize.split('::')[2..].reverse
69
69
  .find { |part| self::MODELS_NAMESPACE&.const_defined?(part, false) || part == 'Model' }
70
70
  end
71
71
 
@@ -82,6 +82,8 @@ module Formalism
82
82
  end
83
83
  end
84
84
 
85
+ attr_writer :instance
86
+
85
87
  def initialize(*)
86
88
  @cached =
87
89
  Sequel::Plugins.const_defined?(:StaticCache) &&
@@ -108,13 +110,11 @@ module Formalism
108
110
 
109
111
  def execute
110
112
  # TODO: Check
111
- Actions::Application::Restart.run if @cached && ENV['RACK_ENV'] != 'test'
113
+ Actions::Application::Restart.run if @cached && ENV.fetch('RACK_ENV') != 'test'
112
114
 
113
115
  instance
114
116
  end
115
117
 
116
- attr_writer :instance
117
-
118
118
  def find_instance
119
119
  model
120
120
  .first(primary_field_name => public_send(primary_field_name))
@@ -63,10 +63,7 @@ module Formalism
63
63
  def execute
64
64
  self.instance =
65
65
  if dataset
66
- if @cached
67
- then cached_dataset_for_execute
68
- else non_cached_dataset_for_execute.all
69
- end
66
+ @cached ? cached_dataset_for_execute : non_cached_dataset_for_execute.all
70
67
  else
71
68
  []
72
69
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Formalism
4
4
  module ModelForms
5
- VERSION = '0.8.0'
5
+ VERSION = '0.9.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formalism-model_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-10 00:00:00.000000000 Z
12
+ date: 2022-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alt_memery
@@ -129,42 +129,42 @@ dependencies:
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 0.6.1
132
+ version: 0.12.1
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 0.6.1
139
+ version: 0.12.1
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: toys
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 0.11.0
146
+ version: 0.13.0
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: 0.11.0
153
+ version: 0.13.0
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: codecov
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: 0.4.0
160
+ version: 0.6.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 0.4.0
167
+ version: 0.6.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: rspec
170
170
  requirement: !ruby/object:Gem::Requirement
@@ -193,20 +193,34 @@ dependencies:
193
193
  - - "~>"
194
194
  - !ruby/object:Gem::Version
195
195
  version: 0.21.0
196
+ - !ruby/object:Gem::Dependency
197
+ name: simplecov-cobertura
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: '2.1'
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: '2.1'
196
210
  - !ruby/object:Gem::Dependency
197
211
  name: rubocop
198
212
  requirement: !ruby/object:Gem::Requirement
199
213
  requirements:
200
214
  - - "~>"
201
215
  - !ruby/object:Gem::Version
202
- version: '1.2'
216
+ version: 1.36.0
203
217
  type: :development
204
218
  prerelease: false
205
219
  version_requirements: !ruby/object:Gem::Requirement
206
220
  requirements:
207
221
  - - "~>"
208
222
  - !ruby/object:Gem::Version
209
- version: '1.2'
223
+ version: 1.36.0
210
224
  - !ruby/object:Gem::Dependency
211
225
  name: rubocop-performance
212
226
  requirement: !ruby/object:Gem::Requirement
@@ -265,7 +279,8 @@ licenses:
265
279
  metadata:
266
280
  source_code_uri: https://github.com/AlexWayfer/formalism-model_forms
267
281
  homepage_uri: https://github.com/AlexWayfer/formalism-model_forms
268
- changelog_uri: https://github.com/AlexWayfer/formalism-model_forms/blob/master/CHANGELOG.md
282
+ changelog_uri: https://github.com/AlexWayfer/formalism-model_forms/blob/main/CHANGELOG.md
283
+ rubygems_mfa_required: 'true'
269
284
  post_install_message:
270
285
  rdoc_options: []
271
286
  require_paths:
@@ -274,7 +289,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
289
  requirements:
275
290
  - - ">="
276
291
  - !ruby/object:Gem::Version
277
- version: '2.5'
292
+ version: '2.6'
278
293
  - - "<"
279
294
  - !ruby/object:Gem::Version
280
295
  version: '4'
@@ -284,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
299
  - !ruby/object:Gem::Version
285
300
  version: '0'
286
301
  requirements: []
287
- rubygems_version: 3.2.3
302
+ rubygems_version: 3.3.7
288
303
  signing_key:
289
304
  specification_version: 4
290
305
  summary: Standard Formalism forms for Sequel Models