Method: Togglefy.update

Defined in:
lib/togglefy.rb

.update(identifier, **params) ⇒ Feature Also known as: update_feature

Note:

All parameters but the first (identifier) should be keyword arguments.

Updates an existing feature.

Examples:

Togglefy.update(:new_feature, name: "Updated Feature", description: "Updated feature description")
Togglefy.update(:new_feature, identifier: :updated_feature, group: :support)
Togglefy.update(:new_feature, environment: :staging, tenant_id: "abc123")

Parameters:

  • identifier (Symbol, String)

    The unique identifier of the feature.

  • name (String)

    The name of the feature.

  • identifier (Symbol, String, nil)

    The unique identifier for the feature. Optional, it can also be nil or blank

  • description (String)

    A description of the feature.

  • group (String, Symbol, nil)

    The group the feature belongs to.

  • environment (String, Symbol, nil)

    The environment the feature is for.

  • tenant_id (String)

    The tenant ID the feature is for.

  • status (String, Symbol, Integer)

    The status of the feature.

Returns:

  • (Feature)

    The updated feature.

Raises:



180
181
182
183
184
# File 'lib/togglefy.rb', line 180

def self.update(identifier, **params)
  FeatureManager.new(identifier).update(**params)
rescue ActiveRecord::RecordNotFound
  raise Togglefy::FeatureNotFound, "Couldn't find Togglefy::Feature with identifier '#{identifier}'"
end