---
title: Update from older versions of the Ruby SDK
slug: feature-experimentation/docs/migrate-from-older-versions-ruby
docTags: 
createdAt: 2026-08-05T20:39:57.000Z
---

This section provides code examples for how You should leveraging the new [Decision](docId\:W-MCwQUNp-EC5yaDomerg) and [Event Tracking](docId\:e0Bu1wqkxwIdIw4inzSIC) APIs. All existing [Full Stack (Legacy)](docId:6_ik6SSz-WyJLWuCQw7BT) methods and implementation are still supported. See [Optimizely Feature Experimentation - application & migration](docId\:bykQnE4aGRkC5WXhU6Yi5) documentation for the latest updates.

You should adopting the new `Decide`, `Decide All`, and `Track Event` methods as a more flexible and easier-to-use replacement where you currently use `isFeatureEnabled`, `getFeatureVariable`, `getAllFeatures`, or `Track` calls within your implementation.

The following are examples of how to migrate the Full Stack (Legacy) methods to Feature Experimentation methods:

```ruby
# -------------------------------
# Prereq for new methods: create a user
# ------------------------------
attributes = {'is_logged_in' => true}
user_id = 'user_123'
user = optimizely_client.create_user_context(user_id, attributes)

# -------------------------------
# Is Feature Enabled
# ------------------------------
# old method
enabled = optimizely_client.is_feature_enabled('price_filter', user_id)

# new method
decision = user.decide('flag_1')
enabled = decision.enabled

# -------------------------------
# Activate & Get Variation
# ------------------------------
# old method
variation_key = optimizely_client.activate('my_experiment_key', user_id, attributes)
# new method
variation_key = decision.variation_key

# -------------------------------
# Get All Feature Variables
# ------------------------------
# old method
all_var_values = optimizely_client.get_all_feature_variables(
  'my_feature_key',
  user_id,
  attributes
)
# new method
all_var_values = decision.variables

# -------------------------------
# Get Enabled Features
# ------------------------------
# old method
enabled_features = optimizely_client.get_enabled_features(user_id, attributes)

# new method
decisions = user.decide_all([Optimizely::Decide::OptimizelyDecideOption::ENABLED_FLAGS_ONLY])
enabled_features = decisions.keys
# -------------------------------
# Track
# ------------------------------
# old method
event_tags = {'purchase_count' => 2}
optimizely_client.track('my_purchase_event_key', user_id, attributes, event_tags)

# new method
user.track_event('my_purchase_event_key', event_tags)
```
