rom-elasticsearch 0.2.0 → 0.2.1

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: 4e74b8fa3035dc7923a8d9b9ae9366c59ccf412934bc7a4ff11b4fbc76ec7ac3
4
- data.tar.gz: 3850528b01efb065373bcd31c6d089c11e85872f30dc6c3c02d439dbf81a529f
3
+ metadata.gz: 647ee55a0a3fab8ec9b20787922a1b94e4254ed54a9eacff365bfc9516662523
4
+ data.tar.gz: b522b81b7944c512495062ba3dd6243c7da932ca39b0efbec8935c6027df6fdb
5
5
  SHA512:
6
- metadata.gz: fde4c8952f143d7778b377d3b1ac9168ff700b4e0fb184e6a6ee4c391c6918ce6c75efcd3162990ba580bb1ba4bdc86b964b1d4b1f45e5f2d283b8fc6ba73f9a
7
- data.tar.gz: 23e0871170e5c98b38a4f926c5889094ce89d888e1b87663a122e451870cebd2958d694868ffe79a10fd6eef334fbf5b9915b0f17cf90d11e0a2944da4e88007
6
+ metadata.gz: d717a78441c7777e2871fb177dcafdde2420ba039a358aaa9403d1aa0bad4a9d6e7936e1446f44ce0b4ee5dc7b1c0d92853816a470b3a25c03ebe046c5a6d767
7
+ data.tar.gz: '0379f5ac4de1ede62a6cf21cd5412595bb18674a537a84672b91f667f1179420fcd9d4a30b3220f413eb6215e0e7abaa55cc2c1487b109a32bf648ea71816346'
@@ -1,20 +1,28 @@
1
- ## v0.2.0 2018-01-23
1
+ # v0.2.1 2018-02-06
2
2
 
3
- ## Added
3
+ ### Fixed
4
+
5
+ * Using `read` types in schemas no longer breaks indexing (solnic)
6
+
7
+ [Compare v0.2.0...v0.2.1](https://github.com/rom-rb/rom-elasticsearch/compare/v0.2.0...v0.2.1)
8
+
9
+ # v0.2.0 2018-01-23
10
+
11
+ ### Added
4
12
 
5
13
  * `Relation#order` which sets `:sort` (solnic)
6
14
  * `Relation#page` which sets `:from` offset (solnic)
7
15
  * `Relation#per_page` which sets `:size` (solnic)
8
16
  * `Relation#call` returns custom `ROM::Elasticsearch::Relation::Loaded` object, which provides access to `#total_hits` and raw client response (solnic)
9
17
 
10
- [Compare v0.1.1...v0.2.0](https://github.com/rom-rb/rom/compare/v0.1.1...v0.2.0)
18
+ [Compare v0.1.1...v0.2.0](https://github.com/rom-rb/rom-elasticsearch/compare/v0.1.1...v0.2.0)
11
19
 
12
- ## v0.1.1 2017-11-18
20
+ # v0.1.1 2017-11-18
13
21
 
14
- ## Changed
22
+ ### Changed
15
23
 
16
24
  * Connection URI is passed directly to the ES client now (solnic)
17
25
 
18
- ## v0.1.0 2017-11-17
26
+ # v0.1.0 2017-11-17
19
27
 
20
28
  First public release
@@ -0,0 +1,7 @@
1
+ version: "2"
2
+
3
+ services:
4
+ elasticsearch:
5
+ image: docker.elastic.co/elasticsearch/elasticsearch:6.0.0
6
+ ports:
7
+ - "9200:9200"
@@ -6,7 +6,7 @@ module ROM
6
6
  #
7
7
  # @api public
8
8
  class Attribute < ROM::Attribute
9
- INTERNAL_META_KEYS = %i[name source primary_key].freeze
9
+ INTERNAL_META_KEYS = %i[name source primary_key read].freeze
10
10
  DEFAULT_SORT_DIRECTION = 'asc'.freeze
11
11
 
12
12
  # Return ES mapping properties
@@ -1,5 +1,5 @@
1
1
  module ROM
2
2
  module Elasticsearch
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,25 @@
1
+ RSpec.describe ROM::Elasticsearch::Relation, '.schema' do
2
+ subject(:relation) { relations[:users] }
3
+
4
+ include_context 'setup'
5
+
6
+ before do
7
+ conf.relation(:users) do
8
+ schema(:users) do
9
+ attribute :id, ROM::Elasticsearch::Types::ID
10
+ attribute :name, ROM::Elasticsearch::Types.Text, read: ROM::Types.Constructor(Symbol, &:to_sym)
11
+ end
12
+ end
13
+ end
14
+
15
+ it 'defines read/write types' do
16
+ relation.create_index
17
+
18
+ relation.command(:create).call(id: 1, name: 'Jane')
19
+
20
+ user = relation.get(1).one
21
+
22
+ expect(user[:id]).to be(1)
23
+ expect(user[:name]).to be(:Jane)
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Nevalainen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-23 00:00:00.000000000 Z
12
+ date: 2018-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rom-core
@@ -100,6 +100,7 @@ files:
100
100
  - LICENSE.txt
101
101
  - README.md
102
102
  - Rakefile
103
+ - docker-compose.yml
103
104
  - lib/rom-elasticsearch.rb
104
105
  - lib/rom/elasticsearch.rb
105
106
  - lib/rom/elasticsearch/attribute.rb
@@ -116,6 +117,7 @@ files:
116
117
  - lib/rom/elasticsearch/version.rb
117
118
  - rom-elasticsearch.gemspec
118
119
  - spec/integration/rom/elasticsearch/relation/command_spec.rb
120
+ - spec/integration/rom/elasticsearch/relation/schema_spec.rb
119
121
  - spec/shared/setup.rb
120
122
  - spec/shared/unit/user_fixtures.rb
121
123
  - spec/shared/unit/users.rb
@@ -167,6 +169,7 @@ specification_version: 4
167
169
  summary: ROM adapter for Elasticsearch
168
170
  test_files:
169
171
  - spec/integration/rom/elasticsearch/relation/command_spec.rb
172
+ - spec/integration/rom/elasticsearch/relation/schema_spec.rb
170
173
  - spec/shared/setup.rb
171
174
  - spec/shared/unit/user_fixtures.rb
172
175
  - spec/shared/unit/users.rb