Ran
|
Files
22
|
Run time
3s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<a href="https://github.com/ruby-grape/grape-swagger/commit/<a class=hub.com/ruby-grape/grape-swagger/commit/8f978dc8d23fe9255d4561238c528bddd48fa977">8f978dc8d<a href="https://github.com/ruby-grape/grape-swagger/commit/8f978dc8d23fe9255d4561238c528bddd48fa977">">Use full entity name as a default (fixes #779) (#786) * Use full entity name as a default (fixes #779) I just wanted to resolve this: ``` - model.to_s.split(&#39;::&#39;).last + model.to_s ``` But I met a problem that it receives Class type in here https://github.com/ruby-grape/grape-swagger/blob/</a><a class="double-link" href="https://github.com/ruby-grape/grape-swagger/commit/<a class="double-link" href="https://github.com/ruby-grape/grape-swagger/commit/8abddd5f2ce5fe29238990b136625f34371b0be0">8abddd5f2</a>">8abddd5f2</a><a href="https://github.com/ruby-grape/grape-swagger/commit/8f978dc8d23fe9255d4561238c528bddd48fa977">/lib/grape-swagger/endpoint.rb#L354 But String type in the another place, where the type is generated. So, splitting and taking the last actually returns the same as `name` method of the class. That is very strange I think. Also, if we, for example, use such constructions, we end up with just `V1` and `V2` fron the `A::B` module as they are parsed first: ```ruby module A module B class V1 < Grape::Entity ... class V2 < Grape::Entity ... module A module C class V1 < Grape::Entity ... class V2 < Grape::Entity ... ``` This PR fixes this issue. * Update CHANGELOG * Fix for old Ruby versions * Skip Representable:: prefix just like Entity:: * Add upgrade entry and move changelog entry from fixes to features scope
922 of 932 relevant lines covered (98.93%)
324.75 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|