Skip to content

Instantly share code, notes, and snippets.

@wasnotrice
Created May 25, 2009 19:52
Show Gist options
  • Select an option

  • Save wasnotrice/117716 to your computer and use it in GitHub Desktop.

Select an option

Save wasnotrice/117716 to your computer and use it in GitHub Desktop.
# from casted_model_spec.rb
class WithCastedModelMixin < Hash
include CouchRest::CastedModel
property :name
property :no_value
property :details, :default => {}
property :casted_attribute, :cast_as => 'WithCastedModelMixin'
end
class DummyModel < CouchRest::ExtendedDocument
use_database TEST_SERVER.default_database
raise "Default DB not set" if TEST_SERVER.default_database.nil?
property :casted_attribute, :cast_as => 'WithCastedModelMixin'
property :keywords, :cast_as => ["String"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment