Skip to content
Snippets Groups Projects
Commit 1f31c8de authored by Arnaud Levy's avatar Arnaud Levy
Browse files
parent 4743bf13
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ class Server::WebsitesController < Server::ApplicationController
has_scope :for_production
has_scope :for_update
has_scope :for_search_term
has_scope :for_updatable_theme
def index
@websites = apply_scopes(Communication::Website.all).ordered
......
......@@ -90,6 +90,7 @@ class Communication::Website < ApplicationRecord
", term: "%#{sanitize_sql_like(term)}%")
}
scope :for_update, -> (autoupdate) { where(autoupdate_theme: autoupdate) }
scope :for_updatable_theme, -> (status) { updatable_theme if status == 'true' }
scope :updatable_theme, -> {
where.not(repository: [nil, '']).
where.not(access_token: [nil, '']).
......
......@@ -12,6 +12,10 @@ module Filters
add :for_update,
[{ to_s: 'Automatique', id: 'true' }, { to_s: 'Manuelle', id: 'false' }],
'Filtrer par mode de mise à jour'
add :for_updatable_theme,
[{ to_s: 'Mise à jour automatique possible', id: 'true' }],
'Filtrer par capacité de mise à jour automatique'
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment