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

Null dont get deleted when using array #193

Open
ketuls opened this issue May 15, 2015 · 2 comments
Open

Null dont get deleted when using array #193

ketuls opened this issue May 15, 2015 · 2 comments

Comments

@ketuls
Copy link

ketuls commented May 15, 2015

I am using couch-rest model gem and below is my snippet code.

class S
include CouchRest::Model::Embeddable
property :s1, String
property :s2, String
end

class P < CouchRest::Model::Base
property :name, String
property :xx, [S]
end

p =P.new
p.xx << S.new(s1: "S1 EXISTS")
p.xx << S.new(s2: "S2 EXISTS")
p.save

Now my doubt is when i do p.save "null" get stored in the couchdb, which I dont want. If i don't use array, then null gets auto deleted , I want the same feature for the array as well.

Can you please suggest something?
screen shot 2015-05-15 at 7 31 21 pm

@ketuls
Copy link
Author

ketuls commented May 15, 2015

screen shot 2015-05-15 at 7 37 03 pm

@samlown
Copy link
Member

samlown commented Sep 19, 2015

Looks like the "null" handling on embedded models is not working as expected with arrays. I've not noticed this in the past. I'm planning to refactor some of the attribute handling, so I'll try and fix this then, unless I receive a pull request earlier ;-)

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

2 participants