serialized_virtual_attributes 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86fdc0bafa6793a814c7f9da5bf1c30cea216f65
4
- data.tar.gz: 0116c895c0ffee17d75c768a14fe083d3439499d
3
+ metadata.gz: cecd1e3b85adda0ba6cfbf3e7b1b9fb5ed948156
4
+ data.tar.gz: 9765ca68bf0c3306838e9123aee7a6de00abca21
5
5
  SHA512:
6
- metadata.gz: 77813048164c0c4995fbf3e3989ecc0ab518ec7cb188d79a99838ca61ddf00ecab3c7daf35778343d5fb3cee89f0dedc5c2bc929ddb99558a70bd84dfaad0944
7
- data.tar.gz: 0a8115e903907d860eb96dd4afe6a35dce7823345aa2f7719ad24e030d0c9ce1f73f43a417196b5c4a6debe67c7b098e76fffce8ddb9325ce3774711a31fca79
6
+ metadata.gz: df4d73d9925b5449e28ba955eaa8b913db84ead7ddb593272891310282a957aee352de6441edfe60bbe9b3a8e9a0f44bb1f6f7caa2a1459668c3bd6b6ee96fb7
7
+ data.tar.gz: 4858d1dac626a9bcb0e7b4cdebb951b0039d85183d9e86bd7422428e3bae23f6dbc62d4e09b689c28d7bf25ad7ba212043d597e2d78c77df7f13f7e06d3ee8b0
data/README.md CHANGED
@@ -58,7 +58,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
58
58
 
59
59
  ## Contributing
60
60
 
61
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/serialized_virtual_attributes.
61
+ Bug reports and pull requests are welcome on GitHub at https://github.com/flant/serialized_virtual_attributes.
62
62
 
63
63
 
64
64
  ## License
@@ -1,3 +1,3 @@
1
1
  module SerializedVirtualAttributes
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -12,6 +12,8 @@ module SerializedVirtualAttributes
12
12
  def serialized_virtual_attribute(*args)
13
13
  options = args.extract_options!
14
14
  to = options[:to]
15
+ return unless self.columns_names.include?(to.to_s)
16
+
15
17
  raise ArgumentError.new("option 'to' not provided or it is not serialized to hash") if to.blank? or self.serialized_attributes[to.to_s].try(:object_class) != Hash
16
18
 
17
19
  typecast = options[:typecast]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serialized_virtual_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey.Gnuskov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-05 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler