diff options
| author | Edouard Maffert | 2016-09-09 10:13:18 +0200 |
|---|---|---|
| committer | Edouard Maffert | 2016-09-09 10:13:18 +0200 |
| commit | febca10492e68c10a18f48860577bf21748bc7cd (patch) | |
| tree | e46ea4f92ae2d8b5408a4f6acbca8660dce29f5d /app/controllers | |
| parent | a1f01c4eb5b3f8cc587775fedc825bbfb2f100d9 (diff) | |
| parent | 4425686bdf93f9d90187244b2f336043934cc75e (diff) | |
| download | chouette-core-febca10492e68c10a18f48860577bf21748bc7cd.tar.bz2 | |
Merge branch 'master' into staging
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/line_referentials_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/lines_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/referentials_controller.rb | 25 |
3 files changed, 28 insertions, 3 deletions
diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb index bcc288a2c..e28019eed 100644 --- a/app/controllers/line_referentials_controller.rb +++ b/app/controllers/line_referentials_controller.rb @@ -8,4 +8,8 @@ class LineReferentialsController < BreadcrumbController current_organisation end + def line_referential_params + params.require(:line_referential).permit(:sync_interval) + end + end diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 8c14de06d..71e33630d 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -79,7 +79,7 @@ class LinesController < BreadcrumbController end @q = line_referential.lines.search(params[:q]) - @lines ||= @q.result(:distinct => true).order(:number).paginate(:page => params[:page]).includes([:network, :company]) + @lines ||= @q.result(:distinct => true).where(deactivated: false).order(:number).paginate(:page => params[:page]).includes([:network, :company]) end alias_method :line_referential, :parent diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 34ba37380..28a95c784 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -27,6 +27,15 @@ class ReferentialsController < BreadcrumbController end end + def archive + referential.archive! + redirect_to referential_path, notice: t('notice.referential.archived') + end + def unarchive + referential.unarchive! + redirect_to referential_path, notice: t('notice.referential.unarchived') + end + protected alias_method :referential, :resource @@ -53,7 +62,19 @@ class ReferentialsController < BreadcrumbController private def referential_params - params.require(:referential).permit( :id, :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id, :projection_type, :data_format ) + params.require(:referential).permit( + :id, + :name, + :slug, + :prefix, + :time_zone, + :upper_corner, + :lower_corner, + :organisation_id, + :projection_type, + :data_format, + :archived_at + ) end -end +end
\ No newline at end of file |
