mongoa 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -27,5 +27,5 @@ RSpec::Core::RakeTask.new(:spec) do |t|
27
27
  t.rcov = false
28
28
  end
29
29
 
30
- task :spec => :check_dependencies
30
+ # task :spec => :check_dependencies
31
31
  task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.15
1
+ 0.1.16
@@ -42,7 +42,7 @@ module Mongoa
42
42
  protected
43
43
 
44
44
  def association
45
- @association ||= model_class.find_association(name)
45
+ @association ||= find_association(model_class, name)
46
46
  end
47
47
 
48
48
  def model_class
@@ -88,6 +88,11 @@ module Mongoa
88
88
  def reflection_name
89
89
  @reflection ||= association.class_name.underscore
90
90
  end
91
+
92
+ def find_association(model_class, name)
93
+ name_association = model_class.associations.detect {|key, value| key.to_s == name.to_s}
94
+ name_association ? name_association.last : nil
95
+ end
91
96
  end
92
97
  end
93
98
  end
data/mongoa.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoa}
8
- s.version = "0.1.15"
8
+ s.version = "0.1.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott J. Tamosunas"]
12
- s.date = %q{2010-08-26}
12
+ s.date = %q{2010-08-27}
13
13
  s.description = %q{Adds the association and validation macros for Rspec in the same way Shoulda does for ActiveRecord.}
14
14
  s.email = %q{tamosunas@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
26
26
  "lib/mongoa.rb",
27
27
  "lib/mongoa/integrations/rspec2.rb",
28
28
  "lib/mongoa/mongo_mapper/associations/all.rb",
29
- "lib/mongoa/mongo_mapper/improvements/mongo_mapper_associations.rb",
30
29
  "lib/mongoa/mongo_mapper/matchers.rb",
31
30
  "lib/mongoa/mongo_mapper/validations/validate_base.rb",
32
31
  "lib/mongoa/mongo_mapper/validations/validate_inclusion_of.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 15
9
- version: 0.1.15
8
+ - 16
9
+ version: 0.1.16
10
10
  platform: ruby
11
11
  authors:
12
12
  - Scott J. Tamosunas
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-26 00:00:00 -04:00
17
+ date: 2010-08-27 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,6 @@ files:
51
51
  - lib/mongoa.rb
52
52
  - lib/mongoa/integrations/rspec2.rb
53
53
  - lib/mongoa/mongo_mapper/associations/all.rb
54
- - lib/mongoa/mongo_mapper/improvements/mongo_mapper_associations.rb
55
54
  - lib/mongoa/mongo_mapper/matchers.rb
56
55
  - lib/mongoa/mongo_mapper/validations/validate_base.rb
57
56
  - lib/mongoa/mongo_mapper/validations/validate_inclusion_of.rb
@@ -1,12 +0,0 @@
1
- module MongoMapper
2
- module Plugins
3
- module Associations
4
- module ClassMethods
5
- def find_association(name)
6
- name_association = self.associations.detect {|key, value| key.to_s == name.to_s}
7
- name_association ? name_association.last : nil
8
- end
9
- end
10
- end
11
- end
12
- end