Migrate to flipper
This commit is contained in:
parent
28d869e818
commit
65e227c44b
33 changed files with 186 additions and 181 deletions
|
@ -72,23 +72,6 @@ class Administrateur < ApplicationRecord
|
|||
administrateur
|
||||
end
|
||||
|
||||
def feature_enabled?(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features[feature.to_s]
|
||||
end
|
||||
|
||||
def disable_feature(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features.delete(feature.to_s)
|
||||
save
|
||||
end
|
||||
|
||||
def enable_feature(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features[feature.to_s] = true
|
||||
save
|
||||
end
|
||||
|
||||
def owns?(procedure)
|
||||
procedure.administrateurs.include?(self)
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ class DossierOperationLog < ApplicationRecord
|
|||
def self.serialize_subject(subject)
|
||||
if subject.nil?
|
||||
nil
|
||||
elsif !Flipflop.operation_log_serialize_subject?
|
||||
elsif !Flipper.enabled?(:operation_log_serialize_subject)
|
||||
{ id: subject.id }
|
||||
else
|
||||
case subject
|
||||
|
|
|
@ -180,23 +180,6 @@ class Instructeur < ApplicationRecord
|
|||
Follow.where(instructeur: self, dossier: dossier).update_all(attributes)
|
||||
end
|
||||
|
||||
def feature_enabled?(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features[feature.to_s]
|
||||
end
|
||||
|
||||
def disable_feature(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features.delete(feature.to_s)
|
||||
save
|
||||
end
|
||||
|
||||
def enable_feature(feature)
|
||||
Flipflop.feature_set.feature(feature)
|
||||
features[feature.to_s] = true
|
||||
save
|
||||
end
|
||||
|
||||
def young_login_token?
|
||||
trusted_device_token = trusted_device_tokens.order(created_at: :desc).first
|
||||
trusted_device_token&.token_young?
|
||||
|
|
|
@ -87,6 +87,10 @@ class User < ApplicationRecord
|
|||
user
|
||||
end
|
||||
|
||||
def flipper_id
|
||||
"User:#{id}"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def link_invites!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue