diff options
| author | Teddy Wing | 2017-06-14 18:58:13 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-06-14 18:58:13 +0200 |
| commit | a7ead83aba3a3987feaab7ac8b4089a2caa324d3 (patch) | |
| tree | e61e4a8a9b54feac982b8a6a2684845d4b5ef0fd /app | |
| parent | 2e124ae18c975341a3afd49e29eb245ac40c1220 (diff) | |
| download | chouette-core-a7ead83aba3a3987feaab7ac8b4089a2caa324d3.tar.bz2 | |
Move ModelDecorator to a new file; Remove duplicate PaginatingDecorator
Move `ModelDecorator` to a new file now that we know it works and that
we're going to use it. I had previously put these two classes in the
same file as `ReferentialDecorator` because I wanted to test that it
worked before making the code correct.
Also remove the `PaginatingDecorator` because apparently we already have
one, which I didn't realise. Use the existing one instead.
Refs #3479
Diffstat (limited to 'app')
| -rw-r--r-- | app/decorators/model_decorator.rb | 3 | ||||
| -rw-r--r-- | app/decorators/referential_decorator.rb | 17 |
2 files changed, 3 insertions, 17 deletions
diff --git a/app/decorators/model_decorator.rb b/app/decorators/model_decorator.rb new file mode 100644 index 000000000..dee014cc3 --- /dev/null +++ b/app/decorators/model_decorator.rb @@ -0,0 +1,3 @@ +class ModelDecorator < PaginatingDecorator + delegate :model +end diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb index 45a4b38d1..1c2347529 100644 --- a/app/decorators/referential_decorator.rb +++ b/app/decorators/referential_decorator.rb @@ -1,20 +1,3 @@ -# Delegates 'will_paginate' methods -class PaginatingDecorator < Draper::CollectionDecorator - delegate( - :current_page, - :per_page, - :offset, - :total_entries, - :total_pages - ) -end - - -class ModelDecorator < PaginatingDecorator - delegate :model -end - - class ReferentialDecorator < Draper::Decorator delegate_all |
