active_fields 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +0 -1
- data/.rubocop.yml +3 -15
- data/CHANGELOG.md +19 -0
- data/README.md +633 -0
- data/Rakefile +7 -0
- data/app/models/active_fields/application_record.rb +7 -0
- data/app/models/active_fields/field/base.rb +17 -0
- data/{lib/active_fields/models → app/models/active_fields}/field/boolean.rb +14 -9
- data/{lib/active_fields/models → app/models/active_fields}/field/date.rb +16 -12
- data/app/models/active_fields/field/date_array.rb +36 -0
- data/app/models/active_fields/field/date_time.rb +77 -0
- data/app/models/active_fields/field/date_time_array.rb +61 -0
- data/app/models/active_fields/field/decimal.rb +75 -0
- data/app/models/active_fields/field/decimal_array.rb +59 -0
- data/{lib/active_fields/models → app/models/active_fields}/field/enum.rb +34 -17
- data/app/models/active_fields/field/enum_array.rb +64 -0
- data/{lib/active_fields/models → app/models/active_fields}/field/integer.rb +16 -12
- data/app/models/active_fields/field/integer_array.rb +36 -0
- data/{lib/active_fields/models → app/models/active_fields}/field/text.rb +16 -12
- data/app/models/active_fields/field/text_array.rb +39 -0
- data/app/models/active_fields/value.rb +15 -0
- data/app/models/concerns/active_fields/customizable_concern.rb +94 -0
- data/app/models/concerns/active_fields/field_array_concern.rb +25 -0
- data/app/models/concerns/active_fields/field_concern.rb +111 -0
- data/app/models/concerns/active_fields/value_concern.rb +83 -0
- data/config/routes.rb +4 -0
- data/{lib/generators/active_fields/install/templates/create_active_fields_tables.rb.tt → db/migrate/20240229230000_create_active_fields_tables.rb} +8 -6
- data/lib/active_fields/casters/base_caster.rb +8 -2
- data/lib/active_fields/casters/boolean_caster.rb +0 -2
- data/lib/active_fields/casters/date_array_caster.rb +0 -2
- data/lib/active_fields/casters/date_caster.rb +8 -8
- data/lib/active_fields/casters/date_time_array_caster.rb +19 -0
- data/lib/active_fields/casters/date_time_caster.rb +43 -0
- data/lib/active_fields/casters/decimal_array_caster.rb +0 -2
- data/lib/active_fields/casters/decimal_caster.rb +10 -4
- data/lib/active_fields/casters/enum_array_caster.rb +13 -3
- data/lib/active_fields/casters/enum_caster.rb +15 -3
- data/lib/active_fields/casters/integer_array_caster.rb +0 -2
- data/lib/active_fields/casters/integer_caster.rb +2 -4
- data/lib/active_fields/casters/text_array_caster.rb +0 -2
- data/lib/active_fields/casters/text_caster.rb +0 -2
- data/lib/active_fields/config.rb +61 -0
- data/lib/active_fields/customizable_config.rb +24 -0
- data/lib/active_fields/engine.rb +13 -0
- data/lib/active_fields/has_active_fields.rb +19 -0
- data/lib/active_fields/validators/base_validator.rb +7 -3
- data/lib/active_fields/validators/boolean_validator.rb +2 -4
- data/lib/active_fields/validators/date_array_validator.rb +3 -5
- data/lib/active_fields/validators/date_time_array_validator.rb +26 -0
- data/lib/active_fields/validators/date_time_validator.rb +19 -0
- data/lib/active_fields/validators/date_validator.rb +3 -5
- data/lib/active_fields/validators/decimal_array_validator.rb +2 -4
- data/lib/active_fields/validators/decimal_validator.rb +2 -4
- data/lib/active_fields/validators/enum_array_validator.rb +3 -5
- data/lib/active_fields/validators/enum_validator.rb +3 -5
- data/lib/active_fields/validators/integer_array_validator.rb +2 -4
- data/lib/active_fields/validators/integer_validator.rb +2 -4
- data/lib/active_fields/validators/text_array_validator.rb +2 -4
- data/lib/active_fields/validators/text_validator.rb +2 -4
- data/lib/active_fields/version.rb +1 -1
- data/lib/active_fields.rb +47 -7
- data/lib/generators/active_fields/install/USAGE +1 -1
- data/lib/generators/active_fields/install/install_generator.rb +14 -18
- data/lib/tasks/active_fields_tasks.rake +6 -0
- metadata +49 -36
- data/lib/active_fields/models/concerns/concern.rb +0 -16
- data/lib/active_fields/models/concerns/customizable.rb +0 -83
- data/lib/active_fields/models/concerns/field_concern.rb +0 -79
- data/lib/active_fields/models/concerns/value_concern.rb +0 -50
- data/lib/active_fields/models/field/date_array.rb +0 -44
- data/lib/active_fields/models/field/decimal.rb +0 -48
- data/lib/active_fields/models/field/decimal_array.rb +0 -44
- data/lib/active_fields/models/field/enum_array.rb +0 -59
- data/lib/active_fields/models/field/integer_array.rb +0 -34
- data/lib/active_fields/models/field/text_array.rb +0 -35
- data/lib/active_fields/models/field.rb +0 -27
- data/lib/active_fields/models/value.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e668baeb2df705293feec23b2948fd6ca762bd3e5f6671aec273579133cfb368
|
4
|
+
data.tar.gz: a7eac6f5cb2a46e9d246e2d3d8023a9e1995446d92d9c2cf93ab1100f265d283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7007b25907d9f0a25b5ef76bb4b031772a0cdf859243676c242fb57f457dab768b5f629760b68661a3b00aa60601b0bf856911a816313a36a53b74206dbb4b
|
7
|
+
data.tar.gz: 83595ef579ea24057de81a0f5b07563eaf77a0e8e2a78da3b30bbf4f0312246c6ca237590f77d279c990c9765f982e8293958b1df73d92996e2f63dc567990c8
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require:
|
2
|
+
# - rubocop-factory_bot
|
2
3
|
- rubocop-performance
|
3
4
|
- rubocop-rails
|
4
5
|
- rubocop-rake
|
5
6
|
- rubocop-rspec
|
6
|
-
- rubocop-
|
7
|
+
# - rubocop-rspec_rails
|
7
8
|
|
8
9
|
inherit_gem:
|
9
10
|
rubocop-shopify: rubocop.yml
|
@@ -13,7 +14,7 @@ AllCops:
|
|
13
14
|
TargetRailsVersion: 7.1
|
14
15
|
NewCops: enable
|
15
16
|
Exclude:
|
16
|
-
- "
|
17
|
+
- "spec/dummy/db/schema.rb"
|
17
18
|
|
18
19
|
Layout/EmptyLinesAroundAccessModifier:
|
19
20
|
EnforcedStyle: around
|
@@ -45,16 +46,3 @@ RSpec/ContextWording:
|
|
45
46
|
|
46
47
|
RSpec/MultipleExpectations:
|
47
48
|
Enabled: false
|
48
|
-
|
49
|
-
Rails/ApplicationRecord:
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
Rails/Date:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
RSpec/FilePath:
|
56
|
-
Enabled: false
|
57
|
-
|
58
|
-
RSpec/SpecFilePathFormat:
|
59
|
-
Enabled: false
|
60
|
-
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,23 @@
|
|
1
1
|
## [Unreleased]
|
2
|
+
- Precision configuration for decimal fields
|
3
|
+
- Added array field types mix-in `ActiveFields::FieldArrayConcern`
|
4
|
+
- Fixed enum types behavior for blank values
|
5
|
+
- Dummy app
|
6
|
+
- Enhanced values storage format
|
7
|
+
- Do not implicitly create _Active Values_ when saving an _Active Field_ or _Customizable_
|
8
|
+
- Utilize _ActiveRecord_'s nested attributes feature in _Customizable_ models to manage associated _Active Values_
|
9
|
+
- Serialize decimals as strings as _ActiveRecord_ does for JSON columns
|
10
|
+
- Added datetime and datetime array field types
|
11
|
+
- Added fields configuration DSL
|
12
|
+
- Introduced new _Customizable_ setter for _Active Values_ (`active_fields_attributes=`) with a more convenient syntax
|
13
|
+
to replace the default setter (`active_values_attributes=`) from Rails nested attributes feature.
|
14
|
+
|
15
|
+
## [0.2.0] - 2024-06-13
|
16
|
+
|
17
|
+
- Rewritten as a Rails plugin!
|
18
|
+
- Custom field types support
|
19
|
+
- Global configuration options for changing field and value classes
|
20
|
+
- Per-model configuration option for enabling specific field types only
|
2
21
|
|
3
22
|
## [0.1.0] - 2024-05-19
|
4
23
|
|