beerdb-models 1.1.1 → 1.2.0

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: 7a3214a36bec05faea115c2cb1bcb5dd3dff5526
4
- data.tar.gz: c98220129e209b2f6c7d2a89227eb2d721771200
3
+ metadata.gz: 61c3b6f7c9a626c2eaa84b40df4e30239f8ebbbd
4
+ data.tar.gz: c406b32c8144ae48cc7368dabfe87bbdf35c8498
5
5
  SHA512:
6
- metadata.gz: c5319080d890054876e3cbae262b1e869a2c2aa24d1c29e76dab2337652f71333f9b9a24ebda39ef2eecf9f15e56a96d3ad0d4f4008a39289d44b3412cbe1b4b
7
- data.tar.gz: 65fe65c742cf7aa322962e4f7197408f35fda43d6851a01630155c0ac60a90536dc178815f34e74c5ea01f29945806622c24b8c84b6084b79573f39c9153ffd3
6
+ metadata.gz: 7d8854c6879d32ccfaa980d942d38c1c994074b102c2149a140e84ad0705e81522f4d807b2c9f1ab57c16bbaa4ab35f38be43309bc958f1bbf757a926fa412a3
7
+ data.tar.gz: cbeb2f3aacc0113d82ffe4ccf3211d6abc316d6a5f06ce195cd48238f718e7684ae5ba92addf3488a98cc6cc560e264d6e23c7ed50bcba664885c1fadc4280e3
@@ -7,10 +7,13 @@ module BeerDb::Model
7
7
  def initialize( beer )
8
8
  @beer = beer
9
9
  end
10
-
10
+
11
11
  attr_reader :beer
12
-
12
+
13
13
  def as_json
14
+ ## note: as_json returns record as a hash
15
+ ## note: NOT yet converted with to_json or JSON.pretty_generate etc.
16
+
14
17
  brewery = {}
15
18
  if beer.brewery.present?
16
19
  brewery = { key: beer.brewery.key,
@@ -36,8 +39,8 @@ module BeerDb::Model
36
39
  tags: tags,
37
40
  brewery: brewery,
38
41
  country: country }
39
-
40
- data.to_json
42
+
43
+ data
41
44
  end
42
45
 
43
46
  end # class BeerSerializer
@@ -7,10 +7,12 @@ module BeerDb::Model
7
7
  def initialize( brewery )
8
8
  @brewery = brewery
9
9
  end
10
-
10
+
11
11
  attr_reader :brewery
12
-
12
+
13
13
  def as_json
14
+ ## note: as_json returns record as a hash
15
+ ## note: NOT yet converted with to_json or JSON.pretty_generate etc.
14
16
 
15
17
  beers = []
16
18
  brewery.beers.each do |b|
@@ -38,7 +40,7 @@ module BeerDb::Model
38
40
  beers: beers,
39
41
  country: country }
40
42
 
41
- data.to_json
43
+ data
42
44
  end
43
45
 
44
46
  end # class BrewerySerializer
@@ -2,8 +2,8 @@
2
2
 
3
3
  module BeerDb
4
4
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
5
- MINOR = 1
6
- PATCH = 1
5
+ MINOR = 2
6
+ PATCH = 0
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beerdb-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-17 00:00:00.000000000 Z
11
+ date: 2017-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: worlddb-models