我正在尝试将我的ruby对象存储在couchdb与couchrest中。我正在从CouchRest::Model::Base
扩展我的模型但是我仍然无法看到db中的更改。
我已将服务器定义为CouchRest.new,模型中也提到use_database 'players'
# Controller Method
get '/new/:name' do
DB = SERVER.database!('players')
@new_player = Player.new(params['name'])
@new_player.create
"success: #{@new_player.persisted?}" #shows true
# Model
class Player < CouchRest::Model::Base
use_database 'players'
property :name ,String
timestamps!
def initialize(arg)
@name=arg
end
end