active_hash 0.9.7 → 0.9.8

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/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 2012-01-18 (v0.9.8)
2
+ - Make ActiveHash.find with array raise an exception when record cannot be found (mocoso)
3
+
1
4
  2011-09-18 (v0.9.7)
2
5
  - Fixing the setting of a belongs_to_active_hash association by association (not id).
3
6
 
data/active_hash.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  "Vladimir Andrijevik",
27
27
  "Adam Anderson"
28
28
  ]
29
- s.date = %q{2011-09-18}
29
+ s.date = %q{2012-01-18}
30
30
  s.email = %q{jeff@zilkey.com}
31
31
  s.extra_rdoc_files = [
32
32
  "LICENSE",
@@ -123,7 +123,7 @@ module ActiveHash
123
123
  when :all
124
124
  all
125
125
  when Array
126
- all.select { |record| id.to_s.include?(record.id.to_s) }
126
+ id.map { |i| find(i) }
127
127
  else
128
128
  find_by_id(id) || begin
129
129
  raise RecordNotFound.new("Couldn't find #{name} with ID=#{id}")
@@ -1,5 +1,5 @@
1
1
  module ActiveHash
2
2
  module Gem
3
- VERSION = "0.9.7"
3
+ VERSION = "0.9.8"
4
4
  end
5
5
  end
@@ -326,6 +326,12 @@ describe ActiveHash, "Base" do
326
326
  it "returns all matching ids" do
327
327
  Country.find([1, 3]).should == [Country.new(:id => 1), Country.new(:id => 3)]
328
328
  end
329
+
330
+ it "raises ActiveHash::RecordNotFound when id not found" do
331
+ proc do
332
+ Country.find([0, 3])
333
+ end.should raise_error(ActiveHash::RecordNotFound, /Couldn't find Country with ID=0/)
334
+ end
329
335
  end
330
336
  end
331
337
 
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: active_hash
3
- version: !ruby/object:Gem::Version
4
- hash: 53
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.8
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 9
9
- - 7
10
- version: 0.9.7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jeff Dean
14
9
  - Mike Dalessio
15
10
  - Corey Innis
@@ -29,47 +24,38 @@ authors:
29
24
  autorequire:
30
25
  bindir: bin
31
26
  cert_chain: []
32
-
33
- date: 2011-09-18 00:00:00 -04:00
34
- default_executable:
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
27
+ date: 2012-01-18 00:00:00.000000000Z
28
+ dependencies:
29
+ - !ruby/object:Gem::Dependency
37
30
  name: activesupport
38
- prerelease: false
39
- requirement: &id001 !ruby/object:Gem::Requirement
31
+ requirement: &70110988966800 !ruby/object:Gem::Requirement
40
32
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 2
47
- - 2
48
- - 2
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
49
36
  version: 2.2.2
50
37
  type: :runtime
51
- version_requirements: *id001
38
+ prerelease: false
39
+ version_requirements: *70110988966800
52
40
  description:
53
41
  email: jeff@zilkey.com
54
42
  executables: []
55
-
56
43
  extensions: []
57
-
58
- extra_rdoc_files:
44
+ extra_rdoc_files:
59
45
  - LICENSE
60
46
  - README.md
61
- files:
47
+ files:
62
48
  - CHANGELOG
63
49
  - LICENSE
64
50
  - README.md
65
51
  - active_hash.gemspec
66
- - lib/enum/enum.rb
67
- - lib/active_hash.rb
68
- - lib/active_yaml/base.rb
69
52
  - lib/active_file/base.rb
70
- - lib/active_hash/version.rb
71
53
  - lib/active_hash/base.rb
54
+ - lib/active_hash/version.rb
55
+ - lib/active_hash.rb
56
+ - lib/active_yaml/base.rb
72
57
  - lib/associations/associations.rb
58
+ - lib/enum/enum.rb
73
59
  - Gemfile
74
60
  - spec/active_file/base_spec.rb
75
61
  - spec/active_hash/base_spec.rb
@@ -78,41 +64,31 @@ files:
78
64
  - spec/enum/enum_spec.rb
79
65
  - spec/lint_spec.rb
80
66
  - spec/spec_helper.rb
81
- has_rdoc: true
82
67
  homepage: http://github.com/zilkey/active_hash
83
68
  licenses: []
84
-
85
69
  post_install_message:
86
70
  rdoc_options: []
87
-
88
- require_paths:
71
+ require_paths:
89
72
  - lib
90
- required_ruby_version: !ruby/object:Gem::Requirement
73
+ required_ruby_version: !ruby/object:Gem::Requirement
91
74
  none: false
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- hash: 3
96
- segments:
97
- - 0
98
- version: "0"
99
- required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
80
  none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- hash: 3
105
- segments:
106
- - 0
107
- version: "0"
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
108
85
  requirements: []
109
-
110
86
  rubyforge_project:
111
- rubygems_version: 1.6.0
87
+ rubygems_version: 1.8.10
112
88
  signing_key:
113
89
  specification_version: 3
114
90
  summary: An ActiveRecord-like model that uses a hash or file as a datasource
115
- test_files:
91
+ test_files:
116
92
  - Gemfile
117
93
  - spec/active_file/base_spec.rb
118
94
  - spec/active_hash/base_spec.rb