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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 348e5277a6af88cfd52397ab8b50e5a945c3eb8a6db670fe5e18fd4e1e65027c
4
- data.tar.gz: 7a49b75739ccf0270184181c630c00e661159ce214180e1f774c8c96bb797ef9
3
+ metadata.gz: 3e8bbf44746f19ae03204f3238d41433e302883bc243765972a1a069ab005845
4
+ data.tar.gz: a83790ab70b421afc22c71439e7ea98e00998268eba7853eb2310269039b9920
5
5
  SHA512:
6
- metadata.gz: 06b65646b336a5082d5738fa9088dc74076fb94ac6de453718c3550f9f09c47c33267bf45b69e76ca14ee70e38099952cfe1419e9a62f826a3655ffc9e7abbe8
7
- data.tar.gz: f420f96cb01629325d57acf1891883aabe03ced09bec07210f2cada6b49c07d4b9546ef63862c4cd830f75ea4f99df9e64d2ea1de93f64c550a88d0a44cf22de
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
@@ -26,6 +26,10 @@ module ActiveRecordToHash
26
26
 
27
27
  result
28
28
  end
29
+
30
+ ::Rails.application.config.active_record_to_hash.aliases.each do |alias_name|
31
+ send(:alias_method, alias_name, ::Rails.application.config.active_record_to_hash.method_name)
32
+ end
29
33
  end
30
34
  end
31
35
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordToHash
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  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.5.1
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-01-30 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails