fauxsql 0.2.1 → 0.2.2
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/VERSION +1 -1
- data/fauxsql.gemspec +1 -1
- data/lib/fauxsql.rb +4 -0
- data/lib/fauxsql/dsl.rb +1 -0
- data/test/test_fauxsql.rb +9 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/fauxsql.gemspec
CHANGED
data/lib/fauxsql.rb
CHANGED
@@ -100,4 +100,8 @@ module Fauxsql
|
|
100
100
|
value
|
101
101
|
end
|
102
102
|
|
103
|
+
def fauxsql_nested_classes(attribute_name)
|
104
|
+
# Find a list of the nested classes that an attribute has and return them as a list
|
105
|
+
self.class.fauxsql_options[attribute_name][:nest] # provides a list of classes
|
106
|
+
end
|
103
107
|
end
|
data/lib/fauxsql/dsl.rb
CHANGED
data/test/test_fauxsql.rb
CHANGED
@@ -217,6 +217,15 @@ class TestFauxsql < Test::Unit::TestCase
|
|
217
217
|
end
|
218
218
|
|
219
219
|
context "with :nested => *" do
|
220
|
+
|
221
|
+
should "allow reflection on nested classes" do
|
222
|
+
assert_equal [FauxObject], @faux.fauxsql_nested_classes(:things)
|
223
|
+
end
|
224
|
+
|
225
|
+
should "allow reflection on nested classes when there are none" do
|
226
|
+
assert_equal [], @faux.fauxsql_nested_classes(:number)
|
227
|
+
end
|
228
|
+
|
220
229
|
context "on a map" do
|
221
230
|
should "accept nested attributes" do
|
222
231
|
other = FauxObject.create
|