Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

helper.rb: added EmbeddedAsset class and updated Asset class with man…

…y embedded_assets.
  • Loading branch information...
commit 5687ef4a88a58fb3f679fec846ee98b9ce97fb66 1 parent 18e3dcb
Jamie Orchard-Hays authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 test/helper.rb
13 test/helper.rb
View
@@ -25,7 +25,8 @@ def assert_difference(expression, difference = 1, message = nil, &block)
exps.each_with_index do |e, i|
error = "#{e.inspect} didn't change by #{difference}"
error = "#{message}.\n#{error}" if message
- assert_equal(before[i] + difference, eval(e, b), error)
+ after = eval(e, b)
+ assert_equal(before[i] + difference, after, error)
end
end
@@ -49,6 +50,16 @@ class Asset
key :title, String
attachment :image
attachment :file
+ has_many :embedded_assets
+end
+
+class EmbeddedAsset
+ include MongoMapper::EmbeddedDocument
+ plugin Joint
+
+ key :title, String
+ attachment :image
+ attachment :file
end
class BaseModel
Please sign in to comment.
Something went wrong with that request. Please try again.