Last active
August 29, 2015 14:06
-
-
Save no-reply/3e453c2b9d305466c7f6 to your computer and use it in GitHub Desktop.
This file contains 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
require 'spec_helper' | |
require 'mongoid' | |
describe 'Mongoid integration' do | |
before do | |
class Person | |
include Mongoid::Document | |
include ActiveTriples::Identifiable | |
configure :base_uri => 'http://example.org/mongoid/' | |
has_many :posts | |
field :name | |
def self.from_uri(uri) | |
self.find(id: uri.to_s.gsub(Person.resource_class.base_uri, '')) | |
end | |
end | |
end | |
subject { Person.new } | |
it 'tests' do | |
require 'pry' | |
binding.pry | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment