Skip to content

Instantly share code, notes, and snippets.

@johnnygoodman
Created August 31, 2010 06:12
Show Gist options
  • Save johnnygoodman/558619 to your computer and use it in GitHub Desktop.
Save johnnygoodman/558619 to your computer and use it in GitHub Desktop.
testclasses.rb
class Expense
include MongoMapper::Document
key :expense_id, ObjectId
key :amount, Float #FloatToDecimalPrecision
key :date, Time
key :notes, String
key :tags, Array # => company
key :type, String
end
class ExpenseCubicle
extend Cubicle::Aggregation
dimensions :tags, :expression=>'tags[0]'
#dimensions :tags, :expression=>'tags.first' #=> also failed
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment