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: 840c3646ef834da4bfeb760ae59a440136a09b84
4
- data.tar.gz: 25cf44e8833ff79e3870b66361ccdfc2f7913cf5
3
+ metadata.gz: 05d13f42aa38348d9ca558844870b5552d042ebc
4
+ data.tar.gz: 6a123b93d40391e7cd3c0b76332ca85d2c2f5531
5
5
  SHA512:
6
- metadata.gz: a9af2dc153df0bf781a9afbe9053a0246b76a2b0a60d2ab333d1113ce5b3ad68e127c2ab2c9e706d0a9d4c0446fc051d3c82f32a5d22506066425f8627e1e225
7
- data.tar.gz: a439fda466092a2a33750859e7387017b5db9a253eb17ec64d373899425b48c0b3d444c7c21656852c31f4d44bd241b31ca80bbf5d5e59a13d03f9c1978988c2
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module TypedStore
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  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.0
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: 2014-12-09 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord