granite-form 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +1 -1
  3. data/CHANGELOG.md +7 -0
  4. data/Rakefile +4 -0
  5. data/granite-form.gemspec +1 -0
  6. data/lib/granite/form/config.rb +10 -10
  7. data/lib/granite/form/model/associations/nested_attributes.rb +3 -3
  8. data/lib/granite/form/model/associations/reflections/references_many.rb +3 -1
  9. data/lib/granite/form/model/associations/reflections/references_one.rb +3 -1
  10. data/lib/granite/form/model/attributes/attribute.rb +1 -1
  11. data/lib/granite/form/model/attributes/base.rb +13 -16
  12. data/lib/granite/form/model/attributes/collection.rb +1 -1
  13. data/lib/granite/form/model/attributes/dictionary.rb +1 -1
  14. data/lib/granite/form/model/attributes/localized.rb +1 -1
  15. data/lib/granite/form/model/attributes/reference_many.rb +1 -1
  16. data/lib/granite/form/model/attributes/reference_one.rb +1 -9
  17. data/lib/granite/form/model/attributes/reflections/base.rb +1 -5
  18. data/lib/granite/form/model/attributes/reflections/reference_one.rb +0 -4
  19. data/lib/granite/form/model/validations/nested.rb +1 -1
  20. data/lib/granite/form/types/active_support/time_zone.rb +22 -0
  21. data/lib/granite/form/types/array.rb +17 -0
  22. data/lib/granite/form/types/big_decimal.rb +15 -0
  23. data/lib/granite/form/types/boolean.rb +38 -0
  24. data/lib/granite/form/types/date.rb +15 -0
  25. data/lib/granite/form/types/date_time.rb +15 -0
  26. data/lib/granite/form/types/float.rb +15 -0
  27. data/lib/granite/form/types/hash_with_action_controller_parameters.rb +18 -0
  28. data/lib/granite/form/types/integer.rb +13 -0
  29. data/lib/granite/form/types/object.rb +30 -0
  30. data/lib/granite/form/types/string.rb +13 -0
  31. data/lib/granite/form/types/time.rb +15 -0
  32. data/lib/granite/form/types/uuid.rb +22 -0
  33. data/lib/granite/form/types.rb +15 -0
  34. data/lib/granite/form/version.rb +1 -1
  35. data/lib/granite/form.rb +19 -118
  36. data/spec/{lib/granite → granite}/form/active_record/associations_spec.rb +0 -0
  37. data/spec/{lib/granite → granite}/form/active_record/nested_attributes_spec.rb +0 -1
  38. data/spec/{lib/granite → granite}/form/config_spec.rb +22 -10
  39. data/spec/granite/form/extensions_spec.rb +12 -0
  40. data/spec/{lib/granite → granite}/form/model/associations/embeds_many_spec.rb +0 -0
  41. data/spec/{lib/granite → granite}/form/model/associations/embeds_one_spec.rb +0 -0
  42. data/spec/{lib/granite → granite}/form/model/associations/nested_attributes_spec.rb +0 -1
  43. data/spec/{lib/granite → granite}/form/model/associations/persistence_adapters/active_record_spec.rb +0 -0
  44. data/spec/{lib/granite → granite}/form/model/associations/references_many_spec.rb +0 -0
  45. data/spec/{lib/granite → granite}/form/model/associations/references_one_spec.rb +0 -0
  46. data/spec/{lib/granite → granite}/form/model/associations/reflections/embeds_any_spec.rb +0 -0
  47. data/spec/{lib/granite → granite}/form/model/associations/reflections/embeds_many_spec.rb +0 -0
  48. data/spec/{lib/granite → granite}/form/model/associations/reflections/embeds_one_spec.rb +0 -0
  49. data/spec/{lib/granite → granite}/form/model/associations/reflections/references_many_spec.rb +0 -0
  50. data/spec/{lib/granite → granite}/form/model/associations/reflections/references_one_spec.rb +0 -0
  51. data/spec/{lib/granite → granite}/form/model/associations/validations_spec.rb +0 -0
  52. data/spec/{lib/granite → granite}/form/model/associations_spec.rb +0 -0
  53. data/spec/{lib/granite → granite}/form/model/attributes/attribute_spec.rb +4 -46
  54. data/spec/{lib/granite → granite}/form/model/attributes/base_spec.rb +11 -2
  55. data/spec/{lib/granite → granite}/form/model/attributes/collection_spec.rb +0 -0
  56. data/spec/{lib/granite → granite}/form/model/attributes/dictionary_spec.rb +0 -0
  57. data/spec/{lib/granite → granite}/form/model/attributes/localized_spec.rb +1 -1
  58. data/spec/{lib/granite → granite}/form/model/attributes/reflections/attribute_spec.rb +0 -12
  59. data/spec/{lib/granite → granite}/form/model/attributes/reflections/base_spec.rb +1 -1
  60. data/spec/{lib/granite → granite}/form/model/attributes/reflections/collection_spec.rb +0 -0
  61. data/spec/{lib/granite → granite}/form/model/attributes/reflections/dictionary_spec.rb +0 -0
  62. data/spec/{lib/granite → granite}/form/model/attributes/reflections/localized_spec.rb +0 -0
  63. data/spec/{lib/granite → granite}/form/model/attributes/reflections/represents_spec.rb +0 -0
  64. data/spec/{lib/granite → granite}/form/model/attributes/represents_spec.rb +0 -0
  65. data/spec/{lib/granite → granite}/form/model/attributes_spec.rb +0 -0
  66. data/spec/{lib/granite → granite}/form/model/callbacks_spec.rb +0 -0
  67. data/spec/{lib/granite → granite}/form/model/conventions_spec.rb +0 -0
  68. data/spec/{lib/granite → granite}/form/model/dirty_spec.rb +0 -0
  69. data/spec/{lib/granite → granite}/form/model/lifecycle_spec.rb +0 -0
  70. data/spec/{lib/granite → granite}/form/model/persistence_spec.rb +0 -0
  71. data/spec/{lib/granite → granite}/form/model/primary_spec.rb +1 -1
  72. data/spec/{lib/granite → granite}/form/model/representation_spec.rb +0 -0
  73. data/spec/{lib/granite → granite}/form/model/scopes_spec.rb +0 -0
  74. data/spec/{lib/granite → granite}/form/model/validations/associated_spec.rb +0 -0
  75. data/spec/{lib/granite → granite}/form/model/validations/nested_spec.rb +55 -11
  76. data/spec/{lib/granite → granite}/form/model/validations_spec.rb +0 -0
  77. data/spec/{lib/granite → granite}/form/model_spec.rb +0 -0
  78. data/spec/granite/form/types/active_support/time_zone_spec.rb +24 -0
  79. data/spec/granite/form/types/array_spec.rb +13 -0
  80. data/spec/granite/form/types/big_decimal_spec.rb +19 -0
  81. data/spec/granite/form/types/boolean_spec.rb +21 -0
  82. data/spec/granite/form/types/date_spec.rb +18 -0
  83. data/spec/granite/form/types/date_time_spec.rb +20 -0
  84. data/spec/granite/form/types/float_spec.rb +19 -0
  85. data/spec/granite/form/types/hash_with_action_controller_parameters_spec.rb +22 -0
  86. data/spec/granite/form/types/integer_spec.rb +18 -0
  87. data/spec/granite/form/types/object_spec.rb +40 -0
  88. data/spec/granite/form/types/string_spec.rb +13 -0
  89. data/spec/granite/form/types/time_spec.rb +31 -0
  90. data/spec/granite/form/types/uuid_spec.rb +21 -0
  91. data/spec/{lib/granite → granite}/form_spec.rb +0 -0
  92. data/spec/{shared → support/shared}/nested_attribute_examples.rb +0 -0
  93. data/spec/support/shared/type_examples.rb +7 -0
  94. metadata +147 -91
  95. data/spec/lib/granite/form/model/typecasting_spec.rb +0 -193
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::DateTime do
6
+ # rubocop:disable Style/DateTime
7
+ describe 'typecasting' do
8
+ include_context 'type setup', 'DateTime'
9
+ let(:datetime) { DateTime.new(2013, 6, 13, 23, 13) }
10
+
11
+ specify { expect(typecast(nil)).to be_nil }
12
+ specify { expect(typecast('2013-06-13 23:13')).to eq(datetime) }
13
+ specify { expect(typecast('2013-55-55 55:55')).to be_nil }
14
+ specify { expect(typecast('blablabla')).to be_nil }
15
+ specify { expect(typecast(Date.new(2013, 6, 13))).to eq(DateTime.new(2013, 6, 13, 0, 0)) }
16
+ specify { expect(typecast(Time.utc(2013, 6, 13, 23, 13).utc)).to eq(datetime) }
17
+ specify { expect(typecast(DateTime.new(2013, 6, 13, 23, 13))).to eq(datetime) }
18
+ end
19
+ # rubocop:enable Style/DateTime
20
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::Float do
6
+ describe 'typecasting' do
7
+ include_context 'type setup', 'Float'
8
+
9
+ specify { expect(typecast('hello')).to be_nil }
10
+ specify { expect(typecast('123hello')).to be_nil }
11
+ specify { expect(typecast('123')).to eq(123.0) }
12
+ specify { expect(typecast('123.')).to be_nil }
13
+ specify { expect(typecast('123.5')).to eq(123.5) }
14
+ specify { expect(typecast(123)).to eq(123.0) }
15
+ specify { expect(typecast(123.5)).to eq(123.5) }
16
+ specify { expect(typecast(nil)).to be_nil }
17
+ specify { expect(typecast([123.5])).to be_nil }
18
+ end
19
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::HashWithActionControllerParameters do
6
+ describe 'typecasting' do
7
+ include_context 'type setup', 'Hash'
8
+
9
+ before(:all) do
10
+ require 'action_controller'
11
+ Class.new(ActionController::Base)
12
+ end
13
+
14
+ let(:to_h) { {'x' => {'foo' => 'bar'}, 'y' => 2} }
15
+ let(:parameters) { ActionController::Parameters.new(to_h) }
16
+
17
+ specify { expect(typecast(nil)).to be_nil }
18
+ specify { expect(typecast(to_h)).to eq(to_h) }
19
+ specify { expect(typecast(parameters)).to be_nil }
20
+ specify { expect(typecast(parameters.permit(:y, x: [:foo]))).to eq(to_h) }
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::Integer do
6
+ describe 'typecasting' do
7
+ include_context 'type setup', 'Integer'
8
+
9
+ specify { expect(typecast('hello')).to be_nil }
10
+ specify { expect(typecast('123hello')).to be_nil }
11
+ specify { expect(typecast('123')).to eq(123) }
12
+ specify { expect(typecast('123.5')).to eq(123) }
13
+ specify { expect(typecast(123)).to eq(123) }
14
+ specify { expect(typecast(123.5)).to eq(123) }
15
+ specify { expect(typecast(nil)).to be_nil }
16
+ specify { expect(typecast([123])).to be_nil }
17
+ end
18
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::Object do
6
+ subject(:type) { described_class.new(String, reflection, model.new) }
7
+ let(:model) { stub_model }
8
+ let(:reflection) { Granite::Form::Model::Attributes::Reflections::Base.new(:field) }
9
+
10
+ describe '#initialize' do
11
+ it { is_expected.to have_attributes(type: String, reflection: reflection, owner: an_instance_of(model)) }
12
+ end
13
+
14
+ describe 'typecasting' do
15
+ before { stub_class(:descendant) }
16
+
17
+ context 'with Object type' do
18
+ include_context 'type setup', 'Object'
19
+
20
+ specify { expect(typecast('hello')).to eq('hello') }
21
+ specify { expect(typecast([])).to eq([]) }
22
+ specify { expect(typecast(Descendant.new)).to be_a(Descendant) }
23
+ specify { expect(typecast(Object.new)).to be_a(Object) }
24
+ specify { expect(typecast(nil)).to be_nil }
25
+ end
26
+
27
+ context 'with Descendant type' do
28
+ include_context 'type setup', 'Descendant'
29
+
30
+ before { stub_class(:descendant2, Descendant) }
31
+
32
+ specify { expect(typecast('hello')).to be_nil }
33
+ specify { expect(typecast([])).to be_nil }
34
+ specify { expect(typecast(Descendant.new)).to be_a(Descendant) }
35
+ specify { expect(typecast(Descendant2.new)).to be_a(Descendant2) }
36
+ specify { expect(typecast(Object.new)).to be_nil }
37
+ specify { expect(typecast(nil)).to be_nil }
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::String do
6
+ describe 'typecasting' do
7
+ include_context 'type setup', 'String'
8
+
9
+ specify { expect(typecast('hello')).to eq('hello') }
10
+ specify { expect(typecast(123)).to eq('123') }
11
+ specify { expect(typecast(nil)).to be_nil }
12
+ end
13
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::Time do
6
+ # rubocop:disable Style/DateTime
7
+ describe 'typecasting' do
8
+ include_context 'type setup', 'Time'
9
+
10
+ specify { expect(typecast(nil)).to be_nil }
11
+ specify { expect(typecast('2013-06-13 23:13')).to eq('2013-06-13 23:13'.to_time) }
12
+ specify { expect(typecast('2013-55-55 55:55')).to be_nil }
13
+ specify { expect(typecast('blablabla')).to be_nil }
14
+ specify { expect(typecast(Date.new(2013, 6, 13))).to eq(Time.new(2013, 6, 13, 0, 0)) }
15
+ specify { expect(typecast(DateTime.new(2013, 6, 13, 19, 13))).to eq(DateTime.new(2013, 6, 13, 19, 13).to_time) }
16
+ specify { expect(typecast(Time.new(2013, 6, 13, 23, 13))).to eq(Time.new(2013, 6, 13, 23, 13)) }
17
+
18
+ context 'Time.zone set' do
19
+ around { |example| Time.use_zone('Bangkok', &example) }
20
+
21
+ specify { expect(typecast(nil)).to be_nil }
22
+ specify { expect(typecast('2013-06-13 23:13')).to eq(Time.zone.parse('2013-06-13 23:13')) }
23
+ specify { expect(typecast('2013-55-55 55:55')).to be_nil }
24
+ specify { expect(typecast('blablabla')).to be_nil }
25
+ specify { expect(typecast(Date.new(2013, 6, 13))).to eq(Time.new(2013, 6, 13, 0, 0)) }
26
+ specify { expect(typecast(DateTime.new(2013, 6, 13, 19, 13))).to eq(DateTime.new(2013, 6, 13, 19, 13).to_time) }
27
+ specify { expect(typecast(Time.new(2013, 6, 13, 23, 13))).to eq(Time.new(2013, 6, 13, 23, 13)) }
28
+ end
29
+ end
30
+ # rubocop:enable Style/DateTime
31
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Granite::Form::Types::UUID do
6
+ describe 'typecasting' do
7
+ include_context 'type setup', 'Granite::Form::UUID'
8
+ let(:uuid) { Granite::Form::UUID.random_create }
9
+ let(:uuid_tools) { UUIDTools::UUID.random_create }
10
+
11
+ specify { expect(typecast(nil)).to be_nil }
12
+ specify { expect(typecast(Object.new)).to be_nil }
13
+ specify { expect(typecast(uuid_tools)).to be_a Granite::Form::UUID }
14
+ specify { expect(typecast(uuid_tools)).to eq(uuid_tools) }
15
+ specify { expect(typecast(uuid)).to eq(uuid) }
16
+ specify { expect(typecast(uuid.to_s)).to eq(uuid) }
17
+ specify { expect(typecast(uuid.to_i)).to eq(uuid) }
18
+ specify { expect(typecast(uuid.hexdigest)).to eq(uuid) }
19
+ specify { expect(typecast(uuid.raw)).to eq(uuid) }
20
+ end
21
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ shared_context 'type setup' do |type_name|
2
+ let(:model) { stub_model { attribute :column, type_name.constantize } }
3
+
4
+ def typecast(value)
5
+ model.new(column: value).column
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: granite-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyromaniac
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-28 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bump
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: database_cleaner
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -283,55 +297,83 @@ files:
283
297
  - lib/granite/form/model/validations/associated.rb
284
298
  - lib/granite/form/model/validations/nested.rb
285
299
  - lib/granite/form/railtie.rb
300
+ - lib/granite/form/types.rb
301
+ - lib/granite/form/types/active_support/time_zone.rb
302
+ - lib/granite/form/types/array.rb
303
+ - lib/granite/form/types/big_decimal.rb
304
+ - lib/granite/form/types/boolean.rb
305
+ - lib/granite/form/types/date.rb
306
+ - lib/granite/form/types/date_time.rb
307
+ - lib/granite/form/types/float.rb
308
+ - lib/granite/form/types/hash_with_action_controller_parameters.rb
309
+ - lib/granite/form/types/integer.rb
310
+ - lib/granite/form/types/object.rb
311
+ - lib/granite/form/types/string.rb
312
+ - lib/granite/form/types/time.rb
313
+ - lib/granite/form/types/uuid.rb
286
314
  - lib/granite/form/undefined_class.rb
287
315
  - lib/granite/form/version.rb
288
- - spec/lib/granite/form/active_record/associations_spec.rb
289
- - spec/lib/granite/form/active_record/nested_attributes_spec.rb
290
- - spec/lib/granite/form/config_spec.rb
291
- - spec/lib/granite/form/model/associations/embeds_many_spec.rb
292
- - spec/lib/granite/form/model/associations/embeds_one_spec.rb
293
- - spec/lib/granite/form/model/associations/nested_attributes_spec.rb
294
- - spec/lib/granite/form/model/associations/persistence_adapters/active_record_spec.rb
295
- - spec/lib/granite/form/model/associations/references_many_spec.rb
296
- - spec/lib/granite/form/model/associations/references_one_spec.rb
297
- - spec/lib/granite/form/model/associations/reflections/embeds_any_spec.rb
298
- - spec/lib/granite/form/model/associations/reflections/embeds_many_spec.rb
299
- - spec/lib/granite/form/model/associations/reflections/embeds_one_spec.rb
300
- - spec/lib/granite/form/model/associations/reflections/references_many_spec.rb
301
- - spec/lib/granite/form/model/associations/reflections/references_one_spec.rb
302
- - spec/lib/granite/form/model/associations/validations_spec.rb
303
- - spec/lib/granite/form/model/associations_spec.rb
304
- - spec/lib/granite/form/model/attributes/attribute_spec.rb
305
- - spec/lib/granite/form/model/attributes/base_spec.rb
306
- - spec/lib/granite/form/model/attributes/collection_spec.rb
307
- - spec/lib/granite/form/model/attributes/dictionary_spec.rb
308
- - spec/lib/granite/form/model/attributes/localized_spec.rb
309
- - spec/lib/granite/form/model/attributes/reflections/attribute_spec.rb
310
- - spec/lib/granite/form/model/attributes/reflections/base_spec.rb
311
- - spec/lib/granite/form/model/attributes/reflections/collection_spec.rb
312
- - spec/lib/granite/form/model/attributes/reflections/dictionary_spec.rb
313
- - spec/lib/granite/form/model/attributes/reflections/localized_spec.rb
314
- - spec/lib/granite/form/model/attributes/reflections/represents_spec.rb
315
- - spec/lib/granite/form/model/attributes/represents_spec.rb
316
- - spec/lib/granite/form/model/attributes_spec.rb
317
- - spec/lib/granite/form/model/callbacks_spec.rb
318
- - spec/lib/granite/form/model/conventions_spec.rb
319
- - spec/lib/granite/form/model/dirty_spec.rb
320
- - spec/lib/granite/form/model/lifecycle_spec.rb
321
- - spec/lib/granite/form/model/persistence_spec.rb
322
- - spec/lib/granite/form/model/primary_spec.rb
323
- - spec/lib/granite/form/model/representation_spec.rb
324
- - spec/lib/granite/form/model/scopes_spec.rb
325
- - spec/lib/granite/form/model/typecasting_spec.rb
326
- - spec/lib/granite/form/model/validations/associated_spec.rb
327
- - spec/lib/granite/form/model/validations/nested_spec.rb
328
- - spec/lib/granite/form/model/validations_spec.rb
329
- - spec/lib/granite/form/model_spec.rb
330
- - spec/lib/granite/form_spec.rb
331
- - spec/shared/nested_attribute_examples.rb
316
+ - spec/granite/form/active_record/associations_spec.rb
317
+ - spec/granite/form/active_record/nested_attributes_spec.rb
318
+ - spec/granite/form/config_spec.rb
319
+ - spec/granite/form/extensions_spec.rb
320
+ - spec/granite/form/model/associations/embeds_many_spec.rb
321
+ - spec/granite/form/model/associations/embeds_one_spec.rb
322
+ - spec/granite/form/model/associations/nested_attributes_spec.rb
323
+ - spec/granite/form/model/associations/persistence_adapters/active_record_spec.rb
324
+ - spec/granite/form/model/associations/references_many_spec.rb
325
+ - spec/granite/form/model/associations/references_one_spec.rb
326
+ - spec/granite/form/model/associations/reflections/embeds_any_spec.rb
327
+ - spec/granite/form/model/associations/reflections/embeds_many_spec.rb
328
+ - spec/granite/form/model/associations/reflections/embeds_one_spec.rb
329
+ - spec/granite/form/model/associations/reflections/references_many_spec.rb
330
+ - spec/granite/form/model/associations/reflections/references_one_spec.rb
331
+ - spec/granite/form/model/associations/validations_spec.rb
332
+ - spec/granite/form/model/associations_spec.rb
333
+ - spec/granite/form/model/attributes/attribute_spec.rb
334
+ - spec/granite/form/model/attributes/base_spec.rb
335
+ - spec/granite/form/model/attributes/collection_spec.rb
336
+ - spec/granite/form/model/attributes/dictionary_spec.rb
337
+ - spec/granite/form/model/attributes/localized_spec.rb
338
+ - spec/granite/form/model/attributes/reflections/attribute_spec.rb
339
+ - spec/granite/form/model/attributes/reflections/base_spec.rb
340
+ - spec/granite/form/model/attributes/reflections/collection_spec.rb
341
+ - spec/granite/form/model/attributes/reflections/dictionary_spec.rb
342
+ - spec/granite/form/model/attributes/reflections/localized_spec.rb
343
+ - spec/granite/form/model/attributes/reflections/represents_spec.rb
344
+ - spec/granite/form/model/attributes/represents_spec.rb
345
+ - spec/granite/form/model/attributes_spec.rb
346
+ - spec/granite/form/model/callbacks_spec.rb
347
+ - spec/granite/form/model/conventions_spec.rb
348
+ - spec/granite/form/model/dirty_spec.rb
349
+ - spec/granite/form/model/lifecycle_spec.rb
350
+ - spec/granite/form/model/persistence_spec.rb
351
+ - spec/granite/form/model/primary_spec.rb
352
+ - spec/granite/form/model/representation_spec.rb
353
+ - spec/granite/form/model/scopes_spec.rb
354
+ - spec/granite/form/model/validations/associated_spec.rb
355
+ - spec/granite/form/model/validations/nested_spec.rb
356
+ - spec/granite/form/model/validations_spec.rb
357
+ - spec/granite/form/model_spec.rb
358
+ - spec/granite/form/types/active_support/time_zone_spec.rb
359
+ - spec/granite/form/types/array_spec.rb
360
+ - spec/granite/form/types/big_decimal_spec.rb
361
+ - spec/granite/form/types/boolean_spec.rb
362
+ - spec/granite/form/types/date_spec.rb
363
+ - spec/granite/form/types/date_time_spec.rb
364
+ - spec/granite/form/types/float_spec.rb
365
+ - spec/granite/form/types/hash_with_action_controller_parameters_spec.rb
366
+ - spec/granite/form/types/integer_spec.rb
367
+ - spec/granite/form/types/object_spec.rb
368
+ - spec/granite/form/types/string_spec.rb
369
+ - spec/granite/form/types/time_spec.rb
370
+ - spec/granite/form/types/uuid_spec.rb
371
+ - spec/granite/form_spec.rb
332
372
  - spec/spec_helper.rb
333
373
  - spec/support/model_helpers.rb
334
374
  - spec/support/muffle_helper.rb
375
+ - spec/support/shared/nested_attribute_examples.rb
376
+ - spec/support/shared/type_examples.rb
335
377
  - spec/support/translations.rb
336
378
  homepage: ''
337
379
  licenses: []
@@ -351,56 +393,70 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
393
  - !ruby/object:Gem::Version
352
394
  version: '0'
353
395
  requirements: []
354
- rubygems_version: 3.2.33
396
+ rubygems_version: 3.3.26
355
397
  signing_key:
356
398
  specification_version: 4
357
399
  summary: Working with hashes in AR style
358
400
  test_files:
359
- - spec/lib/granite/form/active_record/associations_spec.rb
360
- - spec/lib/granite/form/active_record/nested_attributes_spec.rb
361
- - spec/lib/granite/form/config_spec.rb
362
- - spec/lib/granite/form/model/associations/embeds_many_spec.rb
363
- - spec/lib/granite/form/model/associations/embeds_one_spec.rb
364
- - spec/lib/granite/form/model/associations/nested_attributes_spec.rb
365
- - spec/lib/granite/form/model/associations/persistence_adapters/active_record_spec.rb
366
- - spec/lib/granite/form/model/associations/references_many_spec.rb
367
- - spec/lib/granite/form/model/associations/references_one_spec.rb
368
- - spec/lib/granite/form/model/associations/reflections/embeds_any_spec.rb
369
- - spec/lib/granite/form/model/associations/reflections/embeds_many_spec.rb
370
- - spec/lib/granite/form/model/associations/reflections/embeds_one_spec.rb
371
- - spec/lib/granite/form/model/associations/reflections/references_many_spec.rb
372
- - spec/lib/granite/form/model/associations/reflections/references_one_spec.rb
373
- - spec/lib/granite/form/model/associations/validations_spec.rb
374
- - spec/lib/granite/form/model/associations_spec.rb
375
- - spec/lib/granite/form/model/attributes/attribute_spec.rb
376
- - spec/lib/granite/form/model/attributes/base_spec.rb
377
- - spec/lib/granite/form/model/attributes/collection_spec.rb
378
- - spec/lib/granite/form/model/attributes/dictionary_spec.rb
379
- - spec/lib/granite/form/model/attributes/localized_spec.rb
380
- - spec/lib/granite/form/model/attributes/reflections/attribute_spec.rb
381
- - spec/lib/granite/form/model/attributes/reflections/base_spec.rb
382
- - spec/lib/granite/form/model/attributes/reflections/collection_spec.rb
383
- - spec/lib/granite/form/model/attributes/reflections/dictionary_spec.rb
384
- - spec/lib/granite/form/model/attributes/reflections/localized_spec.rb
385
- - spec/lib/granite/form/model/attributes/reflections/represents_spec.rb
386
- - spec/lib/granite/form/model/attributes/represents_spec.rb
387
- - spec/lib/granite/form/model/attributes_spec.rb
388
- - spec/lib/granite/form/model/callbacks_spec.rb
389
- - spec/lib/granite/form/model/conventions_spec.rb
390
- - spec/lib/granite/form/model/dirty_spec.rb
391
- - spec/lib/granite/form/model/lifecycle_spec.rb
392
- - spec/lib/granite/form/model/persistence_spec.rb
393
- - spec/lib/granite/form/model/primary_spec.rb
394
- - spec/lib/granite/form/model/representation_spec.rb
395
- - spec/lib/granite/form/model/scopes_spec.rb
396
- - spec/lib/granite/form/model/typecasting_spec.rb
397
- - spec/lib/granite/form/model/validations/associated_spec.rb
398
- - spec/lib/granite/form/model/validations/nested_spec.rb
399
- - spec/lib/granite/form/model/validations_spec.rb
400
- - spec/lib/granite/form/model_spec.rb
401
- - spec/lib/granite/form_spec.rb
402
- - spec/shared/nested_attribute_examples.rb
401
+ - spec/granite/form/active_record/associations_spec.rb
402
+ - spec/granite/form/active_record/nested_attributes_spec.rb
403
+ - spec/granite/form/config_spec.rb
404
+ - spec/granite/form/extensions_spec.rb
405
+ - spec/granite/form/model/associations/embeds_many_spec.rb
406
+ - spec/granite/form/model/associations/embeds_one_spec.rb
407
+ - spec/granite/form/model/associations/nested_attributes_spec.rb
408
+ - spec/granite/form/model/associations/persistence_adapters/active_record_spec.rb
409
+ - spec/granite/form/model/associations/references_many_spec.rb
410
+ - spec/granite/form/model/associations/references_one_spec.rb
411
+ - spec/granite/form/model/associations/reflections/embeds_any_spec.rb
412
+ - spec/granite/form/model/associations/reflections/embeds_many_spec.rb
413
+ - spec/granite/form/model/associations/reflections/embeds_one_spec.rb
414
+ - spec/granite/form/model/associations/reflections/references_many_spec.rb
415
+ - spec/granite/form/model/associations/reflections/references_one_spec.rb
416
+ - spec/granite/form/model/associations/validations_spec.rb
417
+ - spec/granite/form/model/associations_spec.rb
418
+ - spec/granite/form/model/attributes/attribute_spec.rb
419
+ - spec/granite/form/model/attributes/base_spec.rb
420
+ - spec/granite/form/model/attributes/collection_spec.rb
421
+ - spec/granite/form/model/attributes/dictionary_spec.rb
422
+ - spec/granite/form/model/attributes/localized_spec.rb
423
+ - spec/granite/form/model/attributes/reflections/attribute_spec.rb
424
+ - spec/granite/form/model/attributes/reflections/base_spec.rb
425
+ - spec/granite/form/model/attributes/reflections/collection_spec.rb
426
+ - spec/granite/form/model/attributes/reflections/dictionary_spec.rb
427
+ - spec/granite/form/model/attributes/reflections/localized_spec.rb
428
+ - spec/granite/form/model/attributes/reflections/represents_spec.rb
429
+ - spec/granite/form/model/attributes/represents_spec.rb
430
+ - spec/granite/form/model/attributes_spec.rb
431
+ - spec/granite/form/model/callbacks_spec.rb
432
+ - spec/granite/form/model/conventions_spec.rb
433
+ - spec/granite/form/model/dirty_spec.rb
434
+ - spec/granite/form/model/lifecycle_spec.rb
435
+ - spec/granite/form/model/persistence_spec.rb
436
+ - spec/granite/form/model/primary_spec.rb
437
+ - spec/granite/form/model/representation_spec.rb
438
+ - spec/granite/form/model/scopes_spec.rb
439
+ - spec/granite/form/model/validations/associated_spec.rb
440
+ - spec/granite/form/model/validations/nested_spec.rb
441
+ - spec/granite/form/model/validations_spec.rb
442
+ - spec/granite/form/model_spec.rb
443
+ - spec/granite/form/types/active_support/time_zone_spec.rb
444
+ - spec/granite/form/types/array_spec.rb
445
+ - spec/granite/form/types/big_decimal_spec.rb
446
+ - spec/granite/form/types/boolean_spec.rb
447
+ - spec/granite/form/types/date_spec.rb
448
+ - spec/granite/form/types/date_time_spec.rb
449
+ - spec/granite/form/types/float_spec.rb
450
+ - spec/granite/form/types/hash_with_action_controller_parameters_spec.rb
451
+ - spec/granite/form/types/integer_spec.rb
452
+ - spec/granite/form/types/object_spec.rb
453
+ - spec/granite/form/types/string_spec.rb
454
+ - spec/granite/form/types/time_spec.rb
455
+ - spec/granite/form/types/uuid_spec.rb
456
+ - spec/granite/form_spec.rb
403
457
  - spec/spec_helper.rb
404
458
  - spec/support/model_helpers.rb
405
459
  - spec/support/muffle_helper.rb
460
+ - spec/support/shared/nested_attribute_examples.rb
461
+ - spec/support/shared/type_examples.rb
406
462
  - spec/support/translations.rb