active_record_to_hash 0.5.1 → 0.6.0
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 +12 -0
- data/lib/active_record_to_hash.rb +0 -3
- data/lib/active_record_to_hash/active_record.rb +4 -0
- data/lib/active_record_to_hash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e8bbf44746f19ae03204f3238d41433e302883bc243765972a1a069ab005845
|
4
|
+
data.tar.gz: a83790ab70b421afc22c71439e7ea98e00998268eba7853eb2310269039b9920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe083b2d28d5751e5ca19cabf36cd4d8b82c17e88a6e9c703c0d56dfe16ea8b0f46eeed46629f06c11cfd2fbd684b3c9bfc22c1608f44545c4542287b53f6892
|
7
|
+
data.tar.gz: 178ba98dee7b6e7a9865cb998a21f99b2860affbf5553677971a079726370aa1d8af625ee62821d390b1e53178b8de446af97eed177aac9ef91f657eda7fbc49
|
data/README.md
CHANGED
@@ -225,7 +225,19 @@ This is useful for overriding and preparing hashed methods of various patterns.
|
|
225
225
|
end
|
226
226
|
```
|
227
227
|
|
228
|
+
### Use without ActiveRecord
|
228
229
|
|
230
|
+
If you want to use without ActiveRecord, just include `ActiveRecordToHash::ActiveRecord`
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
class ShopData
|
234
|
+
include ActiveModel::Model
|
235
|
+
include ActiveModel::Attributes
|
236
|
+
include ActiveRecordToHash::ActiveRecord
|
237
|
+
|
238
|
+
...
|
239
|
+
end
|
240
|
+
```
|
229
241
|
|
230
242
|
## Contributing
|
231
243
|
|
@@ -9,9 +9,6 @@ module ActiveRecordToHash
|
|
9
9
|
require 'active_record_to_hash/utilities'
|
10
10
|
require 'active_record_to_hash/active_record'
|
11
11
|
::ActiveRecord::Base.send(:include, ::ActiveRecordToHash::ActiveRecord)
|
12
|
-
::Rails.application.config.active_record_to_hash.aliases.each do |alias_name|
|
13
|
-
::ActiveRecord::Base.send(:alias_method, alias_name, ::Rails.application.config.active_record_to_hash.method_name)
|
14
|
-
end
|
15
12
|
end
|
16
13
|
end
|
17
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_to_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masamoto Miyata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|