{"action":"closed","issue":{"number":112,"created_at":"2011-10-22T12:46:19Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"     Failure/Error: it {should validate_presence_of(:total_cost)}\r\n     ArgumentError:\r\n       Can't convert NilClass to Money\r\n     # ./app/models/line_item.rb:20:in `block in <class:LineItem>'\r\n     # ./spec/models/line_item_spec.rb:9:in `block (2 levels) in <top (required)>'\r\n\r\nI understand that the problem is probably being caused because of the composed_of statement and it not being an actual field. What is the proper way to go about validating presence, am I supposed to validate on the *_cents fields?\r\n\r\n    composed_of :total_cost,\r\n      :class_name => \"Money\",\r\n      :mapping => [%w(total_cost_cents cents), %w(GBP currency_as_string)],\r\n      :constructor => Proc.new { |cents, currency| Money.new(cents || 0, currency || Money.default_currency) },\r\n      :converter => Proc.new { |value| value.respond_to?(:to_money) ? value.to_money : raise(ArgumentError, \"Can't convert #{value.class} to Money\") }\r\n\r\n    validates_presence_of :total_cost","comments":3,"title":"validates_presence_of with Shoulda Matchers","updated_at":"2011-10-26T22:18:42Z","url":"https://api.github.com/repos/RubyMoney/money/issues/112","id":2022477,"assignee":null,"milestone":null,"closed_at":"2011-10-26T22:18:42Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/2f68efbb14fd2acbabeb451fabcbe537?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2f68efbb14fd2acbabeb451fabcbe537","url":"https://api.github.com/users/johnrees","id":601961,"login":"johnrees"},"html_url":"https://github.com/RubyMoney/money/issues/112","labels":[],"state":"closed"},"legacy":{"number":112,"action":"closed","issue":2022477}}