-
Notifications
You must be signed in to change notification settings - Fork 1
[BIC-1903] Add configuration for is null / is not valued #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lib/couchbase-orm/utilities/properties_always_exists_in_document.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could also specify whats happen when properties_always_exist_in_document is set and a property is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, by a comment you mean in the code + readme?
If I understand well it will crash, right?
key = "meta().id" if key.to_s == "id" | ||
case | ||
when value.nil? | ||
when value.nil? && use_is_null | ||
"#{key} IS NULL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB : This is should be "#{key} IS NOT NULL"
(fixed in #35 )
Add a property
properties_always_exists_in_document
on model to be able to useIS NULL
instead ofIS NOT VALUED
whentrue