Skip to content

Conversation

@b-boogaard
Copy link
Contributor

Addresses #216 and #10

I read through both of the issues to help guide naming, default behavior etc.

Some basic high level details

  • expose_nil defaults to true
  • is implemented as an unless condition
  • the option is transformed as part of Exposure.compile_conditions

Currently rubocop is failing because my new tests make the describe block too long. I'm not sure how you all typically handle something like this so just let me know what I should do.

Running RuboCop... Inspecting 38 files ...............................C...... Offenses: spec/grape_entity/entity_spec.rb:6:1: C: Metrics/BlockLength: Block has too many lines. [1625/1496] describe Grape::Entity do ... ^^^^^^^^^^^^^^^^^^^^^^^^^ 38 files inspected, 1 offense detected RuboCop failed! 
@coveralls
Copy link

coveralls commented Jan 18, 2018

Coverage Status

Coverage increased (+0.03%) to 95.646% when pulling 5feb848 on b-boogaard:add-expose-nil-opt into 4b0ea7f on ruby-grape:master.

@DmitryTsepelev
Copy link
Contributor

@b-boogaard you can increase Metrics/BlockLength: max value in the rubocop_todo.yml :) or move the whole context to the different spec file

@grape-bot
Copy link

1 Error
🚫 One of the lines below found in CHANGELOG.md doesn’t match the expected format. Please make it look like the other lines, pay attention to periods and spaces.
* Adds expose_nil option - [@b-boogaard](https://github.com/b-boogaard)
* [#288](https://github.com/ruby-grape/grape-entity/pull/288) Fix wrong argument exception when &:block passed to the expose method - [@DmitryTsepelev](https://github.com/DmitryTsepelev).
* [#291](https://github.com/ruby-grape/grape-entity/pull/291) Refactor and simplify various classes and modules - [@DmitryTsepelev](https://github.com/DmitryTsepelev).

Generated by 🚫 danger

@grape-bot
Copy link

grape-bot commented Jan 22, 2018

1 Error
🚫 One of the lines below found in CHANGELOG.md doesn’t match the expected format. Please make it look like the other lines, pay attention to periods and spaces.
* [#291](https://github.com/ruby-grape/grape-entity/pull/291) Refactor and simplify various classes and modules - [@DmitryTsepelev](https://github.com/DmitryTsepelev).
* [#288](https://github.com/ruby-grape/grape-entity/pull/288) Fix wrong argument exception when &:block passed to the expose method - [@DmitryTsepelev](https://github.com/DmitryTsepelev).

Generated by 🚫 danger

 * expose_nil defaults to true * is implemented as an unless condition * the option is transformed as part of Exposure.compile_conditions
@b-boogaard
Copy link
Contributor Author

@DmitryTsepelev I updated the rubocop_todo.yml. It seemed a little presumptuous to do without a green light on my first PR. :)

@LeFnord
Copy link
Member

LeFnord commented Jan 25, 2018

thanks @b-boogaard

@LeFnord LeFnord merged commit 6a4686e into ruby-grape:master Jan 25, 2018
@b-boogaard
Copy link
Contributor Author

Sure thing @LeFnord

@b-boogaard b-boogaard deleted the add-expose-nil-opt branch January 28, 2018 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants