couchrest / couchrest_extended_document

Extends CouchRest with helpers and such
Apache License 2.0
24 stars 5 forks source link

Default attribute guards assume Ruby boolean semantics #4

Closed tapajos closed 14 years ago

tapajos commented 14 years ago

Issue from: http://github.com/couchrest/couchrest/issues#issue/21

The default guard that gets put around a View in an ExtendedDocument checks that the value of doc[attribute] is true. However, JavaScript does not operate like Ruby. For instance, 0 is a false value.

Instead, they should check that "doc[attribute] != null".

samlown commented 14 years ago

Affraid to say, this is actually a couchrest issue, not ExtendedDocument (despite what it looks like!)