elastic_ar_sync 0.1.3 → 0.1.4

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: a843a9b4af147022f7a825ebdf464db1db3eae84072e7a05c7b594690626c00c
4
- data.tar.gz: 9832a3795e7af74850122c412391a55c5bbca261454385e5e1acc13262e484c7
3
+ metadata.gz: af0f13be82cfec282e25814c57cd0b94897e0ada5f5e0887fe07e6aafb66e477
4
+ data.tar.gz: f82e7af22699dfc5cd0e209c4456616c711a900de2732934d04a9a22490b9754
5
5
  SHA512:
6
- metadata.gz: 62095caeaeec0507d0f2357aa0d578be350938ed64afa1b24cf2d167cefe25b70c8a2759e37108ca5e41b32b9a8affd72f4ea0f26fc3fe9a356cba817c8d4902
7
- data.tar.gz: ac74f2a041c26db4cfd1f76a26e3b86954c1d1fa75a3d1bd6228846fa87e1b267bc531ffe67b9875760cf16b7c23071abe9c3c5ef8c0d154a6eff2b9227755f0
6
+ metadata.gz: 7ffa67fb9b31ff93ac71a031d1d18e5484ca618fe247996313112c5939a61a505db3f7e7abbda04c87fa4c844ee9563f340c78bf254a4209f8a3aaae600029fa
7
+ data.tar.gz: 25345728724a21b73bb805c38f8a6730015fb7dba096075da5da7c2f306e3769fcb62e6fe4f581f39249f220454898ed2311a6ecb5374797885a10934f30c94d
data/README.md CHANGED
@@ -94,7 +94,17 @@ index_config(override_mappings: { birth: :keyword })
94
94
 
95
95
  then birth will mapping as keyword type in index of elasticsearch.
96
96
 
97
- if you define your original mapping additionally, you can define like below.
97
+ if you want add mapping which is not defined as schema column of model, you can save method result as well like below.
98
+
99
+ ```ruby
100
+ index_config(override_mappings: { full_name: :keyword })
101
+ ```
102
+
103
+ *`full_name` is instance method
104
+
105
+ then full_name will mapped to index mapping as keyword type. but you have to define instance method full_name to your model class.
106
+
107
+ if you define your original mapping additionally, you can also define like below.
98
108
 
99
109
  ```ruby
100
110
  settings index: { number_of_shards: number_of_shards } do
@@ -37,7 +37,9 @@ module ElasticArSync
37
37
  end
38
38
 
39
39
  def as_indexed_json(_option = {})
40
- attributes.symbolize_keys.select { |key, _| self.class.mapping_list_keys.include?(key) }
40
+ hash = {}
41
+ self.class.mapping_list_keys.each { |key| hash[key.to_s] = send(key) }
42
+ hash.as_json
41
43
  end
42
44
  end
43
45
 
@@ -1,3 +1,3 @@
1
1
  module ElasticArSync
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic_ar_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - KitakatsuTed