-
Notifications
You must be signed in to change notification settings - Fork 153
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
unexposure is unaware of nesting #152
Labels
Comments
For ones who want to 'unexpose' nested exposure for now the solution would be a good combination of two approaches:
|
Right on @marshall-lee, your suggestion of raising an exception on |
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 23, 2015
This one reaches many goals at once: - Fixes ruby-grape#56: now `exposures` is not a hash table but an array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112 - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb` - Fixes ruby-grape#152 - Fixes ruby-grape#153 - Fixes ruby-grape#155 - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 23, 2015
This one reaches many goals at once: - Fixes ruby-grape#56: now `exposures` is not a hash table but an array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112 - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb` - Fixes ruby-grape#152 - Fixes ruby-grape#153 - Fixes ruby-grape#155 - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 24, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%. Version is bumbed to 0.5.0.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 24, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%. Version is bumbed to 0.5.0.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 24, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%. Version is bumbed to 0.5.0.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 27, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 27, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 27, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Jul 27, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 20-30%.
marshall-lee
added a commit
to marshall-lee/grape-entity
that referenced
this issue
Aug 2, 2015
This one reaches many goals at once: - Fixes ruby-grape#56. - `exposures` hash table is removed and substituted with `root_exposures` array. - Due to previous point, tree structure `nested_exposures` based on flat hash table with keys like `root_node__node__node` is removed because now double exposures don't rewrite previously defined so such tree structure is simply incorrect. `NestingExposure` with an array of children is introduced instead. - Ones who want an old rewriting behavior should manually `unexpose`. - Fixes ruby-grape#112. - Fixes ruby-grape#149: runtime `options` are now wrapped in an `Options` object. - Fixes ruby-grape#150: see new `spec/grape_entity/exposure_spec.rb`. - Fixes ruby-grape#152. - Fixes ruby-grape#153. - Fixes ruby-grape#155. - Fixes ruby-grape#156. - All exposure configuration and exposing strategies are extracted to the separate classes. - `key_for`, `name_for` internal methods are removed. - Much of the overhead is gone so performance is increased by 15-30%.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It just deletes attribute from
exposures
table. Of course, it's possible to call it likeunexpose(:some__nested)
but it's a hack that lacks internal representation which now is going to be removed(#151). It also doesn't clear thenested_exposures
table which is potentially buggy.I propose to temporarily forbid calling
unexpose
inside of nesting exposure (with exception) because it's unclear what to unexpose in this case. Current documentation says nothing about the callingunexpose
withing nesting exposure so I think it's safe.The text was updated successfully, but these errors were encountered: