elos 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9b373a13fdfe5d02948902ad71a061cabb28833
4
- data.tar.gz: 9e4b4a47b1c2aee9f406d1096b5cd5e460fc33ee
3
+ metadata.gz: 06c65f7e867d46e116583ae614c9e09d3529a62f
4
+ data.tar.gz: 1326e3ae49347d66c60389f6058a6d9a71145ad9
5
5
  SHA512:
6
- metadata.gz: 1e06ab2c2c884a8bcf0777660a4712ed640fe86a3cf5e09956ee2d6db2f213973a80aedc3c78207a1924d8e8eba20651aa156b5646ecbeae3b9e98bc47447322
7
- data.tar.gz: 22aee1d56d123d92b9f8a919ecff12206a02541f60567c50121ee68668c6acfc983142b4d2f1a1ec6cf591ea3292feabf2744fcaba6d35ea135cbb2a4734ab47
6
+ metadata.gz: 9daa4547479d39e657be3ae8e234e61f995e7bf84fd85343d42f4d2991d6e63fa4a3a9a6602a3e53b81d1fa810be39474cbb2e4299b0f4327c252c9765f2b008
7
+ data.tar.gz: 76f1fdbbb484684910e69975e3d38c51710ec2d3ec1dfb575614a4bd4506816e485df2da4316a8c1275c6051886fb0c875e2edace50fb5aa8619342d0425f8a0
@@ -0,0 +1,7 @@
1
+ module Elos::Index::Attributes
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ cattr_accessor :attributes
6
+ end
7
+ end
@@ -18,6 +18,7 @@ module Elos::Index::Mappings
18
18
 
19
19
  def set_mappings(mappings)
20
20
  mps = mappings.is_a?(Proc) ? mappings.() : mappings.deep_dup
21
+ self.attributes = %i(id) + mps[:properties].keys
21
22
  mps[:properties].merge!(_destroyed: boolean_property, json: no_index_string_property) if respond_to?(:physically_destroy?) && physically_destroy?
22
23
  self.mappings = { type_name => mps }
23
24
  end
@@ -0,0 +1,7 @@
1
+ module Elos::Index::Model::Attributes
2
+ extend ActiveSupport::Concern
3
+
4
+ def attributes
5
+ Hash[self.class.attributes.map { |k| [k, send(k)] }]
6
+ end
7
+ end
@@ -6,6 +6,7 @@ module Elos::Index::Model
6
6
  include ActiveModel::Callbacks
7
7
 
8
8
  include Elos::Index::Model::Initializable
9
+ include Elos::Index::Model::Attributes
9
10
  include Elos::Index::Model::Assignable
10
11
  include Elos::Index::Model::Identifiable
11
12
  end
data/lib/elos/index.rb CHANGED
@@ -14,6 +14,7 @@ module Elos::Index
14
14
  include Elos::Index::Searchable
15
15
  include Elos::Index::Locatable
16
16
  include Elos::Index::Subscribable
17
+ include Elos::Index::Attributes
17
18
  include Elos::Index::Model
18
19
  end
19
20
  end
data/lib/elos/lock.rb CHANGED
@@ -2,6 +2,7 @@ class Elos::Lock
2
2
  include Elos::Index::Core
3
3
  include Elos::Index::Properties
4
4
  include Elos::Index::Mappings
5
+ include Elos::Index::Attributes
5
6
 
6
7
  mappings -> do
7
8
  {
data/lib/elos/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Elos
2
- VERSION = '1.0.19'
2
+ VERSION = '1.0.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elos
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsuri Moriya
@@ -151,12 +151,14 @@ files:
151
151
  - lib/elos/errors/validation_failed.rb
152
152
  - lib/elos/helpers.rb
153
153
  - lib/elos/index.rb
154
+ - lib/elos/index/attributes.rb
154
155
  - lib/elos/index/core.rb
155
156
  - lib/elos/index/indexable.rb
156
157
  - lib/elos/index/locatable.rb
157
158
  - lib/elos/index/mappings.rb
158
159
  - lib/elos/index/model.rb
159
160
  - lib/elos/index/model/assignable.rb
161
+ - lib/elos/index/model/attributes.rb
160
162
  - lib/elos/index/model/identifiable.rb
161
163
  - lib/elos/index/model/initializable.rb
162
164
  - lib/elos/index/properties.rb