Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 12 additions and 1 deletion. Show diff stats Hide diff stats

  1. +12 1 test/helper.rb
13 test/helper.rb
@@ -25,7 +25,8 @@ def assert_difference(expression, difference = 1, message = nil, &block)
25 25 exps.each_with_index do |e, i|
26 26 error = "#{e.inspect} didn't change by #{difference}"
27 27 error = "#{message}.\n#{error}" if message
28   - assert_equal(before[i] + difference, eval(e, b), error)
  28 + after = eval(e, b)
  29 + assert_equal(before[i] + difference, after, error)
29 30 end
30 31 end
31 32
@@ -49,6 +50,16 @@ class Asset
49 50 key :title, String
50 51 attachment :image
51 52 attachment :file
  53 + has_many :embedded_assets
  54 +end
  55 +
  56 +class EmbeddedAsset
  57 + include MongoMapper::EmbeddedDocument
  58 + plugin Joint
  59 +
  60 + key :title, String
  61 + attachment :image
  62 + attachment :file
52 63 end
53 64
54 65 class BaseModel

0 comments on commit 5687ef4

Please sign in to comment.
Something went wrong with that request. Please try again.