Skip to content

Instantly share code, notes, and snippets.

@fj
Created May 1, 2012 22:51
Show Gist options
  • Save fj/2572120 to your computer and use it in GitHub Desktop.
Save fj/2572120 to your computer and use it in GitHub Desktop.
let(:address_model) do
Class.new do
include ActiveModel
include ActiveModel::Validations
include HasAddress
def initialize(attributes = {})
@attributes = attributes
end
def [](attr)
@attributes[attr]
end
def []=(attr, value)
@attributes[attr] = value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment