cfoundry 0.3.24 → 0.3.25
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cfoundry/v2/model.rb +7 -2
- data/lib/cfoundry/version.rb +1 -1
- metadata +4 -4
data/lib/cfoundry/v2/model.rb
CHANGED
@@ -63,7 +63,9 @@ module CFoundry::V2
|
|
63
63
|
|
64
64
|
def to_one(name, opts = {})
|
65
65
|
obj = opts[:as] || name
|
66
|
-
kls = obj.to_s.capitalize
|
66
|
+
kls = obj.to_s.capitalize.gsub(/(.)_(.)/) do
|
67
|
+
$1 + $2.upcase
|
68
|
+
end
|
67
69
|
|
68
70
|
define_method(name) {
|
69
71
|
if @manifest && @manifest[:entity].key?(name)
|
@@ -92,11 +94,14 @@ module CFoundry::V2
|
|
92
94
|
|
93
95
|
def to_many(plural, opts = {})
|
94
96
|
singular = plural.to_s.sub(/s$/, "").to_sym
|
95
|
-
kls = singular.to_s.capitalize
|
96
97
|
|
97
98
|
object = opts[:as] || singular
|
98
99
|
plural_object = :"#{object}s"
|
99
100
|
|
101
|
+
kls = object.to_s.capitalize.gsub(/(.)_(.)/) do
|
102
|
+
$1 + $2.upcase
|
103
|
+
end
|
104
|
+
|
100
105
|
define_method(plural) { |*args|
|
101
106
|
depth, query = args
|
102
107
|
|
data/lib/cfoundry/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 33
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 25
|
10
|
+
version: 0.3.25
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Suraci
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-08-
|
18
|
+
date: 2012-08-30 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rest-client
|