Created
August 29, 2011 14:28
-
-
Save jgonera/1178503 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # project.rb | |
| class Store | |
| include Mongoid::Document | |
| end | |
| class Project | |
| include Mongoid::Document | |
| field :name | |
| embeds_one :store, as: :project | |
| end | |
| # dropbox_store.rb | |
| require 'project' | |
| class DropboxStore < Store | |
| #include Mongoid::Document | |
| field :session | |
| field :path | |
| embedded_in :project, polymorphic: true | |
| validates_presence_of :path | |
| after_initialize :load_session | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment