gummi 0.3.3 → 0.3.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.
data/lib/gummi/version.rb
CHANGED
data/lib/repobahn/repository.rb
CHANGED
@@ -42,11 +42,13 @@ module Repobahn
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def db_instances_to_entities(db_instances)
|
45
|
+
return [] unless db_instances.present?
|
45
46
|
entities = Array(db_instances).map { |db_instance| db_instance_to_entity(db_instance) }
|
46
47
|
entities.length > 1 ? entities : entities.first
|
47
48
|
end
|
48
49
|
|
49
50
|
def db_instance_to_entity(db_instance)
|
51
|
+
return nil unless db_instance.present?
|
50
52
|
entity = entity_class.new(db_instance.attributes)
|
51
53
|
run_hook :after_conversion, entity, db_instance
|
52
54
|
entity
|
@@ -38,9 +38,9 @@ describe Gummi::RepositoryLayer::Repository do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
describe '.search', elastic: true do
|
41
|
-
let
|
42
|
-
let(:buzz)
|
43
|
-
let(:woody)
|
41
|
+
let(:people) { People.new }
|
42
|
+
let(:buzz) { DB::Person.create name: 'Buzz Lightyear' }
|
43
|
+
let(:woody) { DB::Person.create name: 'Woody' }
|
44
44
|
|
45
45
|
before do
|
46
46
|
buzz && woody
|
@@ -67,10 +67,10 @@ describe Gummi::RepositoryLayer::Repository do
|
|
67
67
|
search.query_string = 'Woody'
|
68
68
|
end
|
69
69
|
woody = result.records.first
|
70
|
-
result.facets.should
|
70
|
+
result.facets.should be_empty
|
71
71
|
woody.converted_name.should == 'ydooW'
|
72
72
|
woody.should be_a Person
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gummi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: virtus
|
@@ -269,12 +269,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
269
269
|
- - ! '>='
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '0'
|
272
|
+
segments:
|
273
|
+
- 0
|
274
|
+
hash: 2870271869803985356
|
272
275
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
276
|
none: false
|
274
277
|
requirements:
|
275
278
|
- - ! '>='
|
276
279
|
- !ruby/object:Gem::Version
|
277
280
|
version: '0'
|
281
|
+
segments:
|
282
|
+
- 0
|
283
|
+
hash: 2870271869803985356
|
278
284
|
requirements: []
|
279
285
|
rubyforge_project:
|
280
286
|
rubygems_version: 1.8.23
|