Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't look like the update_at fields properly updates #221

Open
mathieujobin opened this issue May 7, 2017 · 0 comments
Open

doesn't look like the update_at fields properly updates #221

mathieujobin opened this issue May 7, 2017 · 0 comments

Comments

@mathieujobin
Copy link

(byebug) x
#<Setting updated_at: 2017-05-07 21:16:18 UTC, created_at: 2017-05-07 21:16:18 UTC, oid: "planet:c9f62372-6346-4a7b-818b-253758fd9b20", data: {"rock"=>"abc", "paper"=>"ok"}, _id: "41b5a4ae9eb9829225876d89ba43407c", _rev: "1-3f674e78841f531e959aee8f322b2b1b", type: "Setting">
(byebug) x.save
true
(byebug) x
#<Setting updated_at: 2017-05-07 21:16:18 UTC, created_at: 2017-05-07 21:16:18 UTC, oid: "planet:c9f62372-6346-4a7b-818b-253758fd9b20", data: {"rock"=>"abc", "paper"=>"ok"}, _id: "41b5a4ae9eb9829225876d89ba43407c", _rev: "1-3f674e78841f531e959aee8f322b2b1b", type: "Setting">
(byebug) x.data["papexxxr"] = "ok"
"ok"
(byebug) x.save!
true
(byebug) x
#<Setting updated_at: 2017-05-07 21:16:18 UTC, created_at: 2017-05-07 21:16:18 UTC, oid: "planet:c9f62372-6346-4a7b-818b-253758fd9b20", data: {"rock"=>"abc", "paper"=>"ok", "papexxxr"=>"ok"}, _id: "41b5a4ae9eb9829225876d89ba43407c", _rev: "1-3f674e78841f531e959aee8f322b2b1b", type: "Setting">
(byebug) 

model is as follow

require 'couchrest_model'

class Setting < CouchRest::Model::Base
  use_database "foo"
  timestamps!
  property :oid, String
  property :data, ActiveSupport::HashWithIndifferentAccess
  validates_presence_of :oid, :data

  design do
    view :by_oid
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant