djsun-mongo_mapper 0.5.6.6 → 0.5.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/.gitignore +3 -1
  2. data/Rakefile +13 -8
  3. data/VERSION +1 -1
  4. data/djsun-mongo_mapper.gemspec +17 -21
  5. data/lib/mongo_mapper/associations/base.rb +32 -36
  6. data/lib/mongo_mapper/associations/many_documents_as_proxy.rb +0 -2
  7. data/lib/mongo_mapper/associations/many_documents_proxy.rb +19 -10
  8. data/lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb +2 -2
  9. data/lib/mongo_mapper/associations/many_embedded_proxy.rb +21 -36
  10. data/lib/mongo_mapper/associations/many_polymorphic_proxy.rb +1 -1
  11. data/lib/mongo_mapper/associations/proxy.rb +3 -2
  12. data/lib/mongo_mapper/associations.rb +114 -8
  13. data/lib/mongo_mapper/callbacks.rb +18 -0
  14. data/lib/mongo_mapper/document.rb +173 -37
  15. data/lib/mongo_mapper/dynamic_finder.rb +1 -1
  16. data/lib/mongo_mapper/embedded_document.rb +9 -13
  17. data/lib/mongo_mapper/finder_options.rb +67 -44
  18. data/lib/mongo_mapper/pagination.rb +2 -0
  19. data/lib/mongo_mapper/serialization.rb +1 -1
  20. data/lib/mongo_mapper/serializers/json_serializer.rb +1 -1
  21. data/lib/mongo_mapper/support.rb +9 -0
  22. data/lib/mongo_mapper/validations.rb +12 -42
  23. data/lib/mongo_mapper.rb +11 -5
  24. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +5 -5
  25. data/test/functional/associations/test_belongs_to_proxy.rb +29 -31
  26. data/test/functional/associations/test_many_documents_as_proxy.rb +5 -5
  27. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +27 -3
  28. data/test/functional/associations/test_many_embedded_proxy.rb +58 -38
  29. data/test/functional/associations/test_many_polymorphic_proxy.rb +45 -3
  30. data/test/functional/associations/test_many_proxy.rb +61 -11
  31. data/test/functional/test_associations.rb +3 -3
  32. data/test/functional/test_binary.rb +1 -1
  33. data/test/functional/test_callbacks.rb +1 -1
  34. data/test/functional/test_dirty.rb +3 -3
  35. data/test/functional/test_document.rb +62 -58
  36. data/test/functional/test_embedded_document.rb +1 -1
  37. data/test/functional/test_pagination.rb +1 -1
  38. data/test/functional/test_rails_compatibility.rb +1 -1
  39. data/test/functional/test_validations.rb +46 -14
  40. data/test/models.rb +87 -35
  41. data/test/support/{test_timing.rb → timing.rb} +1 -1
  42. data/test/test_helper.rb +8 -13
  43. data/test/unit/serializers/test_json_serializer.rb +0 -4
  44. data/test/unit/test_association_base.rb +24 -8
  45. data/test/unit/test_document.rb +40 -71
  46. data/test/unit/test_embedded_document.rb +27 -67
  47. data/test/unit/test_finder_options.rb +16 -0
  48. data/test/unit/test_key.rb +5 -17
  49. data/test/unit/test_mongomapper.rb +2 -2
  50. data/test/unit/test_pagination.rb +4 -0
  51. metadata +10 -12
  52. data/mongo_mapper.gemspec +0 -170
  53. data/test/functional/associations/test_namespace.rb +0 -27
data/mongo_mapper.gemspec DELETED
@@ -1,170 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{mongo_mapper}
8
- s.version = "0.5.6"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["John Nunemaker"]
12
- s.date = %q{2009-10-22}
13
- s.default_executable = %q{mmconsole}
14
- s.description = %q{Awesome gem for modeling your domain and storing it in mongo}
15
- s.email = %q{nunemaker@gmail.com}
16
- s.executables = ["mmconsole"]
17
- s.extra_rdoc_files = [
18
- "LICENSE",
19
- "README.rdoc"
20
- ]
21
- s.files = [
22
- ".gitignore",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "bin/mmconsole",
28
- "lib/mongo_mapper.rb",
29
- "lib/mongo_mapper/associations.rb",
30
- "lib/mongo_mapper/associations/base.rb",
31
- "lib/mongo_mapper/associations/belongs_to_polymorphic_proxy.rb",
32
- "lib/mongo_mapper/associations/belongs_to_proxy.rb",
33
- "lib/mongo_mapper/associations/many_documents_as_proxy.rb",
34
- "lib/mongo_mapper/associations/many_documents_proxy.rb",
35
- "lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb",
36
- "lib/mongo_mapper/associations/many_embedded_proxy.rb",
37
- "lib/mongo_mapper/associations/many_polymorphic_proxy.rb",
38
- "lib/mongo_mapper/associations/many_proxy.rb",
39
- "lib/mongo_mapper/associations/proxy.rb",
40
- "lib/mongo_mapper/callbacks.rb",
41
- "lib/mongo_mapper/dirty.rb",
42
- "lib/mongo_mapper/document.rb",
43
- "lib/mongo_mapper/dynamic_finder.rb",
44
- "lib/mongo_mapper/embedded_document.rb",
45
- "lib/mongo_mapper/finder_options.rb",
46
- "lib/mongo_mapper/key.rb",
47
- "lib/mongo_mapper/observing.rb",
48
- "lib/mongo_mapper/pagination.rb",
49
- "lib/mongo_mapper/rails_compatibility/document.rb",
50
- "lib/mongo_mapper/rails_compatibility/embedded_document.rb",
51
- "lib/mongo_mapper/serialization.rb",
52
- "lib/mongo_mapper/serializers/json_serializer.rb",
53
- "lib/mongo_mapper/support.rb",
54
- "lib/mongo_mapper/validations.rb",
55
- "mongo_mapper.gemspec",
56
- "specs.watchr",
57
- "test/NOTE_ON_TESTING",
58
- "test/functional/associations/test_belongs_to_polymorphic_proxy.rb",
59
- "test/functional/associations/test_belongs_to_proxy.rb",
60
- "test/functional/associations/test_many_documents_as_proxy.rb",
61
- "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
62
- "test/functional/associations/test_many_embedded_proxy.rb",
63
- "test/functional/associations/test_many_polymorphic_proxy.rb",
64
- "test/functional/associations/test_many_proxy.rb",
65
- "test/functional/test_associations.rb",
66
- "test/functional/test_binary.rb",
67
- "test/functional/test_callbacks.rb",
68
- "test/functional/test_dirty.rb",
69
- "test/functional/test_document.rb",
70
- "test/functional/test_embedded_document.rb",
71
- "test/functional/test_logger.rb",
72
- "test/functional/test_pagination.rb",
73
- "test/functional/test_rails_compatibility.rb",
74
- "test/functional/test_validations.rb",
75
- "test/models.rb",
76
- "test/support/custom_matchers.rb",
77
- "test/support/test_timing.rb",
78
- "test/test_helper.rb",
79
- "test/unit/serializers/test_json_serializer.rb",
80
- "test/unit/test_association_base.rb",
81
- "test/unit/test_document.rb",
82
- "test/unit/test_dynamic_finder.rb",
83
- "test/unit/test_embedded_document.rb",
84
- "test/unit/test_finder_options.rb",
85
- "test/unit/test_key.rb",
86
- "test/unit/test_mongomapper.rb",
87
- "test/unit/test_observing.rb",
88
- "test/unit/test_pagination.rb",
89
- "test/unit/test_rails_compatibility.rb",
90
- "test/unit/test_serializations.rb",
91
- "test/unit/test_support.rb",
92
- "test/unit/test_time_zones.rb",
93
- "test/unit/test_validations.rb"
94
- ]
95
- s.homepage = %q{http://github.com/jnunemaker/mongomapper}
96
- s.rdoc_options = ["--charset=UTF-8"]
97
- s.require_paths = ["lib"]
98
- s.rubygems_version = %q{1.3.5}
99
- s.summary = %q{Awesome gem for modeling your domain and storing it in mongo}
100
- s.test_files = [
101
- "test/functional/associations/test_belongs_to_polymorphic_proxy.rb",
102
- "test/functional/associations/test_belongs_to_proxy.rb",
103
- "test/functional/associations/test_many_documents_as_proxy.rb",
104
- "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
105
- "test/functional/associations/test_many_embedded_proxy.rb",
106
- "test/functional/associations/test_many_polymorphic_proxy.rb",
107
- "test/functional/associations/test_many_proxy.rb",
108
- "test/functional/test_associations.rb",
109
- "test/functional/test_binary.rb",
110
- "test/functional/test_callbacks.rb",
111
- "test/functional/test_dirty.rb",
112
- "test/functional/test_document.rb",
113
- "test/functional/test_embedded_document.rb",
114
- "test/functional/test_logger.rb",
115
- "test/functional/test_pagination.rb",
116
- "test/functional/test_rails_compatibility.rb",
117
- "test/functional/test_validations.rb",
118
- "test/models.rb",
119
- "test/support/custom_matchers.rb",
120
- "test/support/test_timing.rb",
121
- "test/test_helper.rb",
122
- "test/unit/serializers/test_json_serializer.rb",
123
- "test/unit/test_association_base.rb",
124
- "test/unit/test_document.rb",
125
- "test/unit/test_dynamic_finder.rb",
126
- "test/unit/test_embedded_document.rb",
127
- "test/unit/test_finder_options.rb",
128
- "test/unit/test_key.rb",
129
- "test/unit/test_mongomapper.rb",
130
- "test/unit/test_observing.rb",
131
- "test/unit/test_pagination.rb",
132
- "test/unit/test_rails_compatibility.rb",
133
- "test/unit/test_serializations.rb",
134
- "test/unit/test_support.rb",
135
- "test/unit/test_time_zones.rb",
136
- "test/unit/test_validations.rb"
137
- ]
138
-
139
- if s.respond_to? :specification_version then
140
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
141
- s.specification_version = 3
142
-
143
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
144
- s.add_runtime_dependency(%q<activesupport>, [">= 2.3"])
145
- s.add_runtime_dependency(%q<mongo>, ["= 0.15.1"])
146
- s.add_runtime_dependency(%q<jnunemaker-validatable>, ["= 1.8.0"])
147
- s.add_development_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
148
- s.add_development_dependency(%q<shoulda>, ["= 2.10.2"])
149
- s.add_development_dependency(%q<timecop>, ["= 0.3.1"])
150
- s.add_development_dependency(%q<mocha>, ["= 0.9.4"])
151
- else
152
- s.add_dependency(%q<activesupport>, [">= 2.3"])
153
- s.add_dependency(%q<mongo>, ["= 0.15.1"])
154
- s.add_dependency(%q<jnunemaker-validatable>, ["= 1.8.0"])
155
- s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
156
- s.add_dependency(%q<shoulda>, ["= 2.10.2"])
157
- s.add_dependency(%q<timecop>, ["= 0.3.1"])
158
- s.add_dependency(%q<mocha>, ["= 0.9.4"])
159
- end
160
- else
161
- s.add_dependency(%q<activesupport>, [">= 2.3"])
162
- s.add_dependency(%q<mongo>, ["= 0.15.1"])
163
- s.add_dependency(%q<jnunemaker-validatable>, ["= 1.8.0"])
164
- s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
165
- s.add_dependency(%q<shoulda>, ["= 2.10.2"])
166
- s.add_dependency(%q<timecop>, ["= 0.3.1"])
167
- s.add_dependency(%q<mocha>, ["= 0.9.4"])
168
- end
169
- end
170
-
@@ -1,27 +0,0 @@
1
- require 'test_helper'
2
- require 'models'
3
-
4
- class NamespaceTest < Test::Unit::TestCase
5
- include Hollywood
6
-
7
- context "Hollywood namespace" do
8
- setup do
9
- @movie = Movie.create
10
- @actor = Actor.create
11
- @role = Role.create(
12
- :movie_id => @movie.id,
13
- :actor_id => @actor.id
14
- )
15
- end
16
-
17
- should "belongs_to associations" do
18
- @role.actor.should == @actor
19
- @role.movie.should == @movie
20
- end
21
-
22
- should "many associations" do
23
- @movie.roles.should == [@role]
24
- @actor.roles.should == [@role]
25
- end
26
- end
27
- end