Add include_nil property option#2
Conversation
|
Should we call that option |
|
I kinda like Nick, do you like |
|
Bernd- here's what mee understands when reading both versions:
|
|
I prefer |
|
Thinking off the cuff here, but how about this most closely describes what you're doing, right? Also, it leaves the door open to configure its representation represent_nil :as => false |
|
@cowboyd Do you mean a global switch to decide if nil properties should be included or not? Cause the problem here is how we define per property whether or not to include it in the doc if it's nil. |
|
I like @cowboyd's version. I guess it would look like this. property :beer, :represent_nil => true
represent_nil :as => false |
|
Ok, one global configuration "how to convert nil values" and a I have to refactor |
|
@apotonick Yes, sounds good! |
|
Is there a current status for this? For me the problem really lies in the parsing, when using :class option and supplying nil's (or not supplying values at all) the parsing breaks ( undefined method `[]' for nil:NilClass ), unless when using a :if => lambda{ !property.is_nil? }, but maybe this is a whole different issue? |
|
@jwkoelewijn Can you show a quick example how to provoke that bug? I'm working on this as I type but I'm not sure if that is directly connected to your issue. |
|
My problem seemed to originate in the Roar gem, so created a pull request with a fix for Roar |
|
The |
|
This option has been renamed to |
|
This is still problematic for me in the case where the value could be populated with a complex object (as opposed to a simple property) property :image, :extend => ImageRepresenter, :render_nil => trueThis completely barfs for me because nil is extended with |
|
This is a bug, the |
|
The nil bug is fixed in 1.2.4. |
revert bundler to just rspec and rubocop
Implements a :include_nil option for properties as mentioned in trailblazer/roar#7.