module Featurable
  extend ActiveSupport::Concern

  included do
    has_many :feature_lists, as: :featurable, dependent: :destroy
  end

  def feature_list_for_locale(locale)
    feature_lists.find_by(locale: locale) || feature_lists.build(locale: locale)
  end

  def load_or_create_feature_list(locale)
    feature_lists.find_by(locale: locale) || feature_lists.create(locale: locale)
  end
end

module Featurable
  extend ActiveSupport::Concern

  included do
    has_many :feature_lists, as: :featurable, dependent: :destroy
  end

  def feature_list_for_locale(locale)
    feature_lists.find_by(locale: locale) || feature_lists.build(locale: locale)
  end

  def load_or_create_feature_list(locale = nil)
    locale = I18n.default_locale if locale.blank?
    feature_lists.find_by(locale: locale) || feature_lists.create!(locale: locale)
  end
end

Fix the remaining cucumber tests
Fix the remaining cucumber tests

params[:locale] is blank when the /features path
is requested without a locale suffix. This was
causing a validation error when creating the
feature list and the view was failing to render
because the path helper was missing a
feature_list_id param.