ar2dto 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/ar2dto/converter.rb +5 -2
- data/lib/ar2dto/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ed18118a357d7325f1cd52ff5e7ee98db4948ef37c43c2a7c17ed2268f8f7fc
|
|
4
|
+
data.tar.gz: 8908094a4f17e86025b34bc9c2134cad4dc3080dcc76818b026e81ba48c666b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58f7ecc1fe49f7936aa441f7bbf2c0dce04f1e0e2ee12d9223e33024e7c0787cdf0e1962109618f906e7a0f3ad19436f5503aa50923c234616c55606b1d70f88
|
|
7
|
+
data.tar.gz: b03ec11afd326e0fea07bc25946b2419fe6ee3c2c487eb4cfbc6ea96700b7dbd09555ef62e291d7426ef4efa2c4cdc04900f7f7a2314e75c380eeccb4522bd2f
|
data/README.md
CHANGED
|
@@ -15,6 +15,7 @@ AR2DTO (ActiveRecord to DTO, pronounced R2-D2 or Artoo-Detoo) is a gem that lets
|
|
|
15
15
|
- [DTO class](#dto-class)
|
|
16
16
|
- [#to_dto](#to_dto)
|
|
17
17
|
- [.to_dto](#to_dto-1)
|
|
18
|
+
- [Examples](#examples)
|
|
18
19
|
- [Development](#development)
|
|
19
20
|
- [Contributing](#contributing)
|
|
20
21
|
- [License](#license)
|
|
@@ -159,6 +160,16 @@ It accepts the same options as `#to_dto` and uses them create each DTO.
|
|
|
159
160
|
|
|
160
161
|
:warning: **Warning!** Given that this method executes the query and brings records into memory, you have to be careful when and how to use it. You may not want to bring all records from a large table into memory. Consider combining it with things such as pagination or batch processing.
|
|
161
162
|
|
|
163
|
+
## Examples
|
|
164
|
+
If you want to look into examples of usages and configurations, you can find:
|
|
165
|
+
- [Option `methods` examples](docs/examples/methods.md)
|
|
166
|
+
- [Option `except` examples](docs/examples/except.md)
|
|
167
|
+
- [Option `only` examples](docs/examples/only.md)
|
|
168
|
+
- [Option `include` examples](docs/examples/include.md)
|
|
169
|
+
- [Option `add_suffix` and `delete_suffix` examples](docs/examples/add_suffix_delete_suffix.md)
|
|
170
|
+
- [Option `active_model_compliance` examples](docs/examples/active_model_compliance.md)
|
|
171
|
+
- [Custom DTO examples](docs/examples/custom_dto.md)
|
|
172
|
+
|
|
162
173
|
## Development
|
|
163
174
|
|
|
164
175
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/ar2dto/converter.rb
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module AR2DTO
|
|
4
4
|
class Converter
|
|
5
|
-
ALLOWED_TYPES = [
|
|
6
|
-
|
|
5
|
+
ALLOWED_TYPES = [
|
|
6
|
+
Symbol, BigDecimal, Regexp, IO, Range, Time, Date, DateTime,
|
|
7
|
+
URI::Generic, Pathname, IPAddr, Process::Status, Exception,
|
|
8
|
+
ActiveSupport::TimeWithZone
|
|
9
|
+
].freeze
|
|
7
10
|
attr_reader :model, :options
|
|
8
11
|
|
|
9
12
|
def initialize(model, options)
|
data/lib/ar2dto/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ar2dto
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Santiago Bartesaghi
|
|
8
8
|
- Martín Jaime Morón
|
|
9
9
|
- Sebastian Herrera
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2025-11-20 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activemodel
|
|
@@ -46,14 +46,14 @@ dependencies:
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - "~>"
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: 1.
|
|
49
|
+
version: 2.1.0
|
|
50
50
|
type: :development
|
|
51
51
|
prerelease: false
|
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
|
54
54
|
- - "~>"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: 1.
|
|
56
|
+
version: 2.1.0
|
|
57
57
|
- !ruby/object:Gem::Dependency
|
|
58
58
|
name: rake
|
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,16 +100,16 @@ dependencies:
|
|
|
100
100
|
name: sqlite3
|
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
|
102
102
|
requirements:
|
|
103
|
-
- - "
|
|
103
|
+
- - ">="
|
|
104
104
|
- !ruby/object:Gem::Version
|
|
105
|
-
version:
|
|
105
|
+
version: '0'
|
|
106
106
|
type: :development
|
|
107
107
|
prerelease: false
|
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements:
|
|
110
|
-
- - "
|
|
110
|
+
- - ">="
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
|
-
version:
|
|
112
|
+
version: '0'
|
|
113
113
|
- !ruby/object:Gem::Dependency
|
|
114
114
|
name: zeitwerk
|
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -124,7 +124,7 @@ dependencies:
|
|
|
124
124
|
- - "~>"
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
126
|
version: 2.6.0
|
|
127
|
-
description:
|
|
127
|
+
description:
|
|
128
128
|
email:
|
|
129
129
|
- santib@hey.com
|
|
130
130
|
- martinmoron7@gmail.com
|
|
@@ -152,7 +152,7 @@ metadata:
|
|
|
152
152
|
bug_tracker_uri: https://github.com/santib/ar2dto/issues
|
|
153
153
|
changelog_uri: https://github.com/santib/ar2dto/releases
|
|
154
154
|
rubygems_mfa_required: 'true'
|
|
155
|
-
post_install_message:
|
|
155
|
+
post_install_message:
|
|
156
156
|
rdoc_options: []
|
|
157
157
|
require_paths:
|
|
158
158
|
- lib
|
|
@@ -167,8 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
167
|
- !ruby/object:Gem::Version
|
|
168
168
|
version: '0'
|
|
169
169
|
requirements: []
|
|
170
|
-
rubygems_version: 3.
|
|
171
|
-
signing_key:
|
|
170
|
+
rubygems_version: 3.5.9
|
|
171
|
+
signing_key:
|
|
172
172
|
specification_version: 4
|
|
173
173
|
summary: Easing the creation of DTOs from your ActiveRecord models.
|
|
174
174
|
test_files: []
|