class Redemption < ActiveRecord::Base
belongs_to :shopping_cart
validates :shopping_cart, presence: true
end
cart = ShoppingCart.create(...)
redemption = Redemption.new(shopping_cart: cart)
redemption.valid?
redemption.errors # => #<ActiveModel::Errors:... @base=#<Redemption id: nil, shopping_cart_id: ..., created_at: nil, updated_at: nil>, @messages={:shopping_cart=>["can't be blank"]}>
This was pretty annoying to run into :/