Skip to content

Commit

Permalink
Make sure models array has uniq models (otherwise it piles up duplica…
Browse files Browse the repository at this point in the history
…tes from previous calls and affects performance severly).
  • Loading branch information
elado authored and dblock committed Nov 1, 2014
1 parent 15604b0 commit cdd877b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 0.8.1 (Next)

* [#91](https://github.com/tim-vandecasteele/grape-swagger/issues/91): Fixed empty field for group parameters' name with type hash or Array - [@dukedave](https://github.com/dukedave).
* [#154](https://github.com/tim-vandecasteele/grape-swagger/pull/154): Allow Classes for type declarations inside documentation - [@mrmargolis](https://github.com/mrmargolis).
* [#154](https://github.com/tim-vandecasteele/grape-swagger/pull/154): Allow classes for type declarations inside documentation - [@mrmargolis](https://github.com/mrmargolis).
* [#162](https://github.com/tim-vandecasteele/grape-swagger/pull/162): Fix performance issue related to having a large number of models - [@elado](https://github.com/elado).
* Your contribution here.

### 0.8.0 (August 30, 2014)
Expand Down
4 changes: 2 additions & 2 deletions lib/grape-swagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def self.setup(options)

http_codes = parse_http_codes(route.route_http_codes, models)

models << @@models if @@models.present?
models |= @@models if @@models.present?

models << route.route_entity if route.route_entity.present?
models |= [route.route_entity] if route.route_entity.present?

models = models_with_included_presenters(models.flatten.compact)

Expand Down

0 comments on commit cdd877b

Please sign in to comment.