activerecord-typedstore 0.5.0 → 0.5.1
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: 05d13f42aa38348d9ca558844870b5552d042ebc
|
4
|
+
data.tar.gz: 6a123b93d40391e7cd3c0b76332ca85d2c2f5531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7df98e7a431d0a690437abb529ce24098d0dfa21743693d7866482a84c838487f3b6001e08c7fc4c90eea897aaf2148383a9c6b000105d0c4e887c75567d78ca
|
7
|
+
data.tar.gz: a945b5ae34683927e73bf3efec0e5feefd47cbf102168522d8e247e45c5146aad0811129192d4d4f939576cad386b98d2f68368754be78ef146148a6c4a619a2
|
@@ -128,7 +128,7 @@ module ActiveRecord::TypedStore
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def coder_for(attr_name)
|
131
|
-
column = self.class.columns_hash[attr_name]
|
131
|
+
column = self.class.columns_hash[attr_name.to_s]
|
132
132
|
return unless column.cast_type.is_a?(::ActiveRecord::Type::Serialized)
|
133
133
|
column.cast_type.coder
|
134
134
|
end
|
@@ -603,6 +603,22 @@ shared_examples 'a db backed model' do
|
|
603
603
|
}.to raise_error(ActiveRecord::StatementInvalid)
|
604
604
|
end
|
605
605
|
|
606
|
+
describe "#write_attribute" do
|
607
|
+
|
608
|
+
it "attr_name can be a string" do
|
609
|
+
value = 12
|
610
|
+
model.send(:write_attribute, 'age', value)
|
611
|
+
expect(model.age).to be == value
|
612
|
+
end
|
613
|
+
|
614
|
+
it "attr_name can be a symbol" do
|
615
|
+
value = 12
|
616
|
+
model.send(:write_attribute, :age, value)
|
617
|
+
expect(model.age).to be == value
|
618
|
+
end
|
619
|
+
|
620
|
+
end
|
621
|
+
|
606
622
|
end
|
607
623
|
|
608
624
|
shared_examples 'a model supporting arrays' do |pg_native=false|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-typedstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|