riak-record 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/riak_record/associations.rb +3 -1
- data/riak-record.gemspec +3 -3
- data/spec/riak_record/associations_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8285191a3c74c9168e390e57fad2f962d955b000
|
4
|
+
data.tar.gz: ee1a2c6137828311072a5d7935f8a72765951709
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e73ef5633ff909a9751fe768bdf0b5732284e1b7180c13b58f46463245d4cb6b3cb321e3e15a0a60452e5cd4f8482b954762b43b075a389350e0c5d61551b8c
|
7
|
+
data.tar.gz: 8b350e7afbc082ea3941ceaf1cc7b8c6be282448fa845e77519e2d1dac29cb06d81ff64ae193e1064c98dcc99b8d5e44133e7837f93d2244c2118bf97ca34e99
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
@@ -37,7 +37,9 @@ module RiakRecord
|
|
37
37
|
|
38
38
|
def #{association_name}
|
39
39
|
@belongs_to_riak_#{association_name} = nil if @belongs_to_riak_#{association_name} && @belongs_to_riak_#{association_name}.id.to_s != Array(#{foreign_key}).first.to_s
|
40
|
-
|
40
|
+
related_id = Array(#{foreign_key}).first
|
41
|
+
@belongs_to_riak_#{association_name} ||= #{class_name}.find(related_id) if related_id
|
42
|
+
@belongs_to_riak_#{association_name}
|
41
43
|
end
|
42
44
|
|
43
45
|
def #{association_name}=(obj)
|
data/riak-record.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: riak-record 0.6.
|
5
|
+
# stub: riak-record 0.6.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "riak-record"
|
9
|
-
s.version = "0.6.
|
9
|
+
s.version = "0.6.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Robert Graff"]
|
14
|
-
s.date = "2014-10-
|
14
|
+
s.date = "2014-10-23"
|
15
15
|
s.description = "RiakRecord is a thin and immature wrapper around riak-ruby-client. It creates a bucket for\n each class, provides a simple finder, and creates attribute reader."
|
16
16
|
s.email = "robert_graff@yahoo.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -52,6 +52,12 @@ describe RiakRecord::Associations do
|
|
52
52
|
expect(post.author.name).to eq(@author.name)
|
53
53
|
end
|
54
54
|
|
55
|
+
it "should not blow up when the relation is nil" do
|
56
|
+
expect{
|
57
|
+
Comment.new.linked_author
|
58
|
+
}.to_not raise_error
|
59
|
+
end
|
60
|
+
|
55
61
|
it "should change the results when you change the foreign key value" do
|
56
62
|
expect{
|
57
63
|
post.author_id = @real_author.id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riak-record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Graff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riak-client
|