mongo_mysql_relations 0.0.3 → 0.0.4

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.
@@ -1,3 +1,3 @@
1
1
  module MongoMysqlRelations
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -62,7 +62,7 @@ module MongoMysqlRelations
62
62
  end
63
63
 
64
64
  if self.instance_variable_get("@#{name}").blank?
65
- self.instance_variable_set("@#{name}", object_class.first(foreign_key => self.id.to_s))
65
+ self.instance_variable_set("@#{name}", object_class.where(foreign_key => self.id.to_s).first)
66
66
  end
67
67
 
68
68
  self.instance_variable_get("@#{name}")
@@ -82,7 +82,7 @@ module MongoMysqlRelations
82
82
  end
83
83
 
84
84
  if self.instance_variable_get("@#{name}").blank?
85
- self.instance_variable_set("@#{name}", object_class.where(object_class.primary_key => self.send("#{name}_id")).first)
85
+ self.instance_variable_set("@#{name}", object_class.where(:id => self.send("#{name}_id")).first)
86
86
  end
87
87
 
88
88
  self.instance_variable_get("@#{name}")
@@ -124,7 +124,7 @@ module MongoMysqlRelations
124
124
  end
125
125
 
126
126
  if self.instance_variable_get("@#{name}").blank?
127
- self.instance_variable_set("@#{name}", object_class.first(foreign_key => self.id))
127
+ self.instance_variable_set("@#{name}", object_class.where(foreign_key => self.id).first)
128
128
  end
129
129
 
130
130
  self.instance_variable_get("@#{name}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_mysql_relations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-18 00:00:00.000000000 Z
12
+ date: 2013-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler