Permalink
Browse files

Removing old code, working on ActiveModel support

  • Loading branch information...
1 parent 56ebe61 commit aad84fa86dff97f824da54856ff0a627d93f91f9 @samlown samlown committed Aug 2, 2012
Showing with 2 additions and 24 deletions.
  1. +1 −1 couchrest_model.gemspec
  2. +1 −5 lib/couchrest/model/base.rb
  3. +0 −18 spec/unit/base_spec.rb
View
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<couchrest>, "~> 1.1.3")
s.add_dependency(%q<mime-types>, "~> 1.15")
- s.add_dependency(%q<activemodel>, ">= 3.1.0")
+ s.add_dependency(%q<activemodel>, "~> 3.2.0")
s.add_dependency(%q<tzinfo>, "~> 0.3.22")
s.add_development_dependency(%q<rspec>, "~> 2.6.0")
s.add_development_dependency(%q<json>, ["~> 1.5.1"])
@@ -3,6 +3,7 @@ module Model
class Base < CouchRest::Document
extend ActiveModel::Naming
+ include ActiveModel::Conversion
include CouchRest::Model::Configuration
include CouchRest::Model::Connection
@@ -62,11 +63,6 @@ def initialize(attributes = {}, options = {})
run_callbacks(:initialize) { self }
end
- def to_key
- new? ? nil : [id]
- end
-
- alias :to_param :id
alias :new_record? :new?
alias :new_document? :new?
View
@@ -560,24 +560,6 @@ def set_name; self.name = "foobar"; end
'index' => "function(doc) { ret = new Document(); ret.add(doc['name'], {'field':'name'}); return ret; }" }
@db.save_doc({'_id' => '_design/search', 'fulltext' => {'cats' => search_function}})
end
-
- it "should be able to paginate through a large set of search results" do
- if couchdb_lucene_available?
- names = []
- Cat.paginated_each(:design_doc => "search", :view_name => "cats",
- :q => 'name:S*', :search => true, :include_docs => true, :per_page => 3) do |cat|
- cat.should_not be_nil
- names << cat.name
- end
-
- names.size.should == 5
- names.should include('Sockington')
- names.should include('Smitty')
- names.should include('Sammy')
- names.should include('Samson')
- names.should include('Simon')
- end
- end
end
end

0 comments on commit aad84fa

Please sign in to comment.