active_redis_orm 0.1.3 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf1a60fe40cbc3ca7157cb6908c6313c8b098f3
|
4
|
+
data.tar.gz: 3181c522dee6fffe76007f91f315e4b1d0d4607f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f342d78a19d49459d42648ad9853b4d706178a971cb0d2c7a4073b3557e4f298ec293fb5c31d5f928f80f0beb1cb145d8be93519132248597aa94f7477ef402
|
7
|
+
data.tar.gz: 3f6192eefe2d7848cec11543b8eb392c56e89d61259504427b13340c986e9bd8fa72965551ace8d756d07db0c539cede1a0cf4ff15b2fc895533a0e2e07c0843
|
@@ -290,6 +290,7 @@ module ActiveRedis
|
|
290
290
|
changes[:drops].each do |drop|
|
291
291
|
#{field_name}_object.delete(drop)
|
292
292
|
end
|
293
|
+
#{field_name}.clean!
|
293
294
|
after_set(:#{field_name})
|
294
295
|
end
|
295
296
|
}
|
@@ -323,6 +324,7 @@ module ActiveRedis
|
|
323
324
|
changes[:drops].each do |drop|
|
324
325
|
#{field_name}_object.delete(drop)
|
325
326
|
end
|
327
|
+
#{field_name}.clean!
|
326
328
|
after_set(:#{field_name})
|
327
329
|
end
|
328
330
|
}
|
@@ -357,6 +359,7 @@ module ActiveRedis
|
|
357
359
|
changes[:drops].each do |drop|
|
358
360
|
self.#{field_name}_object.delete(drop)
|
359
361
|
end
|
362
|
+
#{field_name}.clean!
|
360
363
|
after_set(:#{field_name})
|
361
364
|
end
|
362
365
|
}
|
@@ -387,6 +390,7 @@ module ActiveRedis
|
|
387
390
|
changes[:drops].each do |drop|
|
388
391
|
#{field_name}_hash_set.delete(drop)
|
389
392
|
end
|
393
|
+
#{field_name}.clean!
|
390
394
|
after_set(:#{field_name})
|
391
395
|
end
|
392
396
|
}
|
data/lib/active_redis/version.rb
CHANGED
data/spec/lib/attributes_spec.rb
CHANGED
@@ -2,10 +2,11 @@ require "active_redis_orm"
|
|
2
2
|
|
3
3
|
describe ActiveRedis do
|
4
4
|
class AttributesObject < ActiveRedis::Base
|
5
|
-
attr_accessible :foo, :bar, :list
|
5
|
+
attr_accessible :foo, :bar, :list, :string
|
6
6
|
field :foo, default: lambda{|item| item.id}
|
7
7
|
field :bar, default: "barbar"
|
8
|
-
field :
|
8
|
+
field :string
|
9
|
+
field :list, type: :list
|
9
10
|
end
|
10
11
|
|
11
12
|
it "deals with attributes in string or symbol implementation" do
|
@@ -14,8 +15,22 @@ describe ActiveRedis do
|
|
14
15
|
end
|
15
16
|
|
16
17
|
it "sets the defaults" do
|
17
|
-
item = AttributesObject.create(
|
18
|
+
item = AttributesObject.create(string: "123")
|
18
19
|
item.foo.should == item.id
|
19
20
|
item.bar.should == "barbar"
|
20
21
|
end
|
22
|
+
|
23
|
+
context "lists" do
|
24
|
+
it "is dirty only when dirty" do
|
25
|
+
instance = AttributesObject.new
|
26
|
+
instance.string = "abc"
|
27
|
+
instance.save
|
28
|
+
|
29
|
+
instance.list << "a"
|
30
|
+
instance.save
|
31
|
+
instance.list.should_not be_dirty
|
32
|
+
instance.should_not be_dirty
|
33
|
+
instance.reload!.list.should == ["a"]
|
34
|
+
end
|
35
|
+
end
|
21
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_redis_orm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Caspy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|