mongoid-indifferent-access 0.0.4 → 1.0.0
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.
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mongoid-indifferent-access (0.0
|
|
4
|
+
mongoid-indifferent-access (1.0.0)
|
|
5
5
|
mongoid
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -13,17 +13,17 @@ GEM
|
|
|
13
13
|
activesupport (3.2.8)
|
|
14
14
|
i18n (~> 0.6)
|
|
15
15
|
multi_json (~> 1.0)
|
|
16
|
-
builder (3.0.
|
|
16
|
+
builder (3.0.3)
|
|
17
17
|
diff-lcs (1.1.3)
|
|
18
|
-
i18n (0.6.
|
|
19
|
-
mongoid (3.0.
|
|
18
|
+
i18n (0.6.1)
|
|
19
|
+
mongoid (3.0.6)
|
|
20
20
|
activemodel (~> 3.1)
|
|
21
21
|
moped (~> 1.1)
|
|
22
22
|
origin (~> 1.0)
|
|
23
23
|
tzinfo (~> 0.3.22)
|
|
24
|
-
moped (1.2.
|
|
24
|
+
moped (1.2.5)
|
|
25
25
|
multi_json (1.3.6)
|
|
26
|
-
origin (1.0.
|
|
26
|
+
origin (1.0.9)
|
|
27
27
|
rake (0.9.2.2)
|
|
28
28
|
rspec (2.11.0)
|
|
29
29
|
rspec-core (~> 2.11.0)
|
data/README.md
CHANGED
|
@@ -9,7 +9,10 @@ accessed using whichever approach suites the developer.
|
|
|
9
9
|
|
|
10
10
|
Ruby/JRuby
|
|
11
11
|
----------
|
|
12
|
-
Thanks to [travis-ci](http://travis-ci.org) this gem is tested against Ruby 1.9.
|
|
12
|
+
Thanks to [travis-ci](http://travis-ci.org) this gem is tested against Ruby 1.9.3 and JRuby 1.6.7.
|
|
13
|
+
|
|
14
|
+
It should also continue work with Ruby 1.9.2 only if you're using Mongoid 2.4.x. As of Mongoid 3.x, Ruby 1.9.3 or newer is
|
|
15
|
+
[required](http://mongoid.org/en/mongoid/docs/tips.html#ruby).
|
|
13
16
|
|
|
14
17
|
Usage
|
|
15
18
|
-----
|
|
@@ -60,4 +63,14 @@ puts result.data["name"] # => "google"
|
|
|
60
63
|
puts result.data[:value] # => 1.32
|
|
61
64
|
puts result.data[:name] # => "google"
|
|
62
65
|
puts result.data["value"] # => 1.32
|
|
63
|
-
````
|
|
66
|
+
````
|
|
67
|
+
|
|
68
|
+
Contributors
|
|
69
|
+
------------
|
|
70
|
+
|
|
71
|
+
I'd like to give a special shout out to those people who've submitted pull requests (which have been approved and merged):
|
|
72
|
+
|
|
73
|
+
* [incorvia](https://github.com/incorvia)
|
|
74
|
+
* pulls: [1](https://github.com/mindscratch/mongoid-indifferent-access/pull/1), [2](https://github.com/mindscratch/mongoid-indifferent-access/pull/2)
|
|
75
|
+
* [Luke Bergen](https://github.com/lukebergen)
|
|
76
|
+
* pulls: [4](https://github.com/mindscratch/mongoid-indifferent-access/pull/4)
|
|
@@ -3,7 +3,7 @@ module Mongoid
|
|
|
3
3
|
module Hash
|
|
4
4
|
module IndifferentAccess
|
|
5
5
|
|
|
6
|
-
VERSION = "0.0
|
|
6
|
+
VERSION = "1.0.0"
|
|
7
7
|
|
|
8
8
|
def self.included(klass)
|
|
9
9
|
klass.class_eval do
|
|
@@ -32,7 +32,7 @@ module Mongoid
|
|
|
32
32
|
val = super()
|
|
33
33
|
unless val.nil? || val.is_a?(HashWithIndifferentAccess)
|
|
34
34
|
wrapped_hash = val.with_indifferent_access
|
|
35
|
-
self.send(setter_name, wrapped_hash)
|
|
35
|
+
self.send(setter_name, wrapped_hash) unless self.frozen?
|
|
36
36
|
val = wrapped_hash
|
|
37
37
|
end
|
|
38
38
|
val
|
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
|
14
14
|
## the sub! line in the Rakefile
|
|
15
15
|
s.name = 'mongoid-indifferent-access'
|
|
16
|
-
s.version = '0.0
|
|
17
|
-
s.date = '2012-
|
|
16
|
+
s.version = '1.0.0'
|
|
17
|
+
s.date = '2012-10-03'
|
|
18
18
|
s.rubyforge_project = 'mongoid-indifferent-access'
|
|
19
19
|
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
## List the primary authors. If there are a bunch of authors, it's probably
|
|
26
26
|
## better to set the email to an email list or something. If you don't have
|
|
27
27
|
## a custom homepage, consider using your GitHub URL or the like.
|
|
28
|
-
s.authors = ["Craig Wickesser"]
|
|
28
|
+
s.authors = ["Craig Wickesser", "https://github.com/incorvia", "https://github.com/lukebergen"]
|
|
29
29
|
s.email = 'craig@mindscratch.org'
|
|
30
30
|
s.homepage = 'https://github.com/mindscratch/mongoid-indifferent-access'
|
|
31
31
|
|
|
@@ -23,6 +23,14 @@ module Mongoid::Extensions::Hash
|
|
|
23
23
|
@subject.config[:non_existant].should be_nil
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
it "getter continues to work when model is frozen" do
|
|
27
|
+
@subject.attributes["config"] = {}
|
|
28
|
+
@subject.freeze
|
|
29
|
+
expect {
|
|
30
|
+
@subject.config
|
|
31
|
+
}.to_not raise_error
|
|
32
|
+
end
|
|
33
|
+
|
|
26
34
|
describe 'subclasses' do
|
|
27
35
|
|
|
28
36
|
before :each do
|
metadata
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongoid-indifferent-access
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Craig Wickesser
|
|
9
|
+
- https://github.com/incorvia
|
|
10
|
+
- https://github.com/lukebergen
|
|
9
11
|
autorequire:
|
|
10
12
|
bindir: bin
|
|
11
13
|
cert_chain: []
|
|
12
|
-
date: 2012-
|
|
14
|
+
date: 2012-10-03 00:00:00.000000000 Z
|
|
13
15
|
dependencies:
|
|
14
16
|
- !ruby/object:Gem::Dependency
|
|
15
17
|
name: mongoid
|