Class: Operations::FeatureFlagsClient
Constant Summary
collapse
- DEFAULT_UNLEASH_API_VERSION =
1
- FEATURE_FLAGS_CLIENT_TOKEN_PREFIX =
'glffct-'
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#sharding_organization
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Instance Attribute Details
#unleash_app_name ⇒ Object
Returns the value of attribute unleash_app_name.
21
22
23
|
# File 'app/models/operations/feature_flags_client.rb', line 21
def unleash_app_name
@unleash_app_name
end
|
Class Method Details
.find_for_project_and_token(project_id, token) ⇒ Object
25
26
27
28
29
30
|
# File 'app/models/operations/feature_flags_client.rb', line 25
def self.find_for_project_and_token(project_id, token)
return unless project_id
return unless token
where(project_id: project_id).find_by_token(token)
end
|
.prefix_for_feature_flags_client_token ⇒ Object
.update_last_feature_flag_updated_at!(project) ⇒ Object
32
33
34
|
# File 'app/models/operations/feature_flags_client.rb', line 32
def self.update_last_feature_flag_updated_at!(project)
where(project: project).update_all(last_feature_flag_updated_at: Time.current)
end
|
Instance Method Details
#prefix_for_feature_flags_client_token ⇒ Object
56
57
58
|
# File 'app/models/operations/feature_flags_client.rb', line 56
def prefix_for_feature_flags_client_token
self.class.prefix_for_feature_flags_client_token
end
|
#unleash_api_cache_key ⇒ Object
50
51
52
53
54
|
# File 'app/models/operations/feature_flags_client.rb', line 50
def unleash_api_cache_key
"api_version:#{unleash_api_version}:" \
"app_name:#{unleash_app_name}:" \
"updated_at:#{last_feature_flag_updated_at.to_i}"
end
|
#unleash_api_features ⇒ Object
44
45
46
47
48
|
# File 'app/models/operations/feature_flags_client.rb', line 44
def unleash_api_features
return [] unless unleash_app_name.present?
Operations::FeatureFlag.for_unleash_client(project, unleash_app_name)
end
|
#unleash_api_version ⇒ Object