Sha256: d7584f9930d1ffe2d54f57793defb8a0ea2d1c512871687b09eb6c0e724ec146

Contents?: true

Size: 1.16 KB

Versions: 66

Compression:

Stored size: 1.16 KB

Contents

require 'couch_potato'
require 'json/pure' unless defined? ::JSON
::CouchPotato::Config.database_name = 'couch_potato_test'

class CouchPotatoWidget
  include CouchPotato::Persistence

  property :name
  view :by_name, :key => :name


  # mimic the AR interface used in example_steps

  def self.create!(attrs = {})
    CouchPotato.database.save(self.new)
  end

  def self.count
    CouchPotato.database.view(self.by_name).size
  end
end

class CouchPotatoWidgetUsingDatabaseOne
  include CouchPotato::Persistence

  database_name = 'couch_potato_test_one'

  property :name
  view :by_name, :key => :name


  # mimic the AR interface used in example_steps

  def self.create!(attrs = {})
    CouchPotato.database.save(self.new)
  end

  def self.count
    CouchPotato.database.view(self.by_name).size
  end
end

class CouchPotatoWidgetUsingDatabaseTwo
  include CouchPotato::Persistence

  database_name = 'couch_potato_test_two'

  property :name
  view :by_name, :key => :name


  # mimic the AR interface used in example_steps

  def self.create!(attrs = {})
    CouchPotato.database.save(self.new)
  end

  def self.count
    CouchPotato.database.view(self.by_name).size
  end
end

Version data entries

66 entries across 55 versions & 8 rubygems

Version Path
database_cleaner-1.6.2 examples/lib/couchpotato_models.rb
database_cleaner-1.6.1 examples/lib/couchpotato_models.rb
database_cleaner-1.6.0 examples/lib/couchpotato_models.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/examples/lib/couchpotato_models.rb
database_cleaner-1.5.3 examples/lib/couchpotato_models.rb
database_cleaner-1.5.2 examples/lib/couchpotato_models.rb
database_cleaner-1.5.1 examples/lib/couchpotato_models.rb
database_cleaner-1.5.0 examples/lib/couchpotato_models.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/couchpotato_models.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/couchpotato_models.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/database_cleaner-1.4.1/examples/lib/couchpotato_models.rb
database_cleaner-1.4.1 examples/lib/couchpotato_models.rb
database_cleaner-1.4.0 examples/lib/couchpotato_models.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/database_cleaner-1.2.0/examples/lib/couchpotato_models.rb