lib/detour/flaggable.rb
def detour_features
    @detour_features ||= begin
      features = unfiltered_features
      defined_group_flags = Detour::DefinedGroupFlag.without_opt_outs(self).where("feature_id IN (?)", features.map(&:id) << -1) # Prevents NOT IN (NULL)

      defined_group_flags.each do |defined_group_flag|
        defined_group = Detour::DefinedGroup.by_type(self.class)[defined_group_flag.group_name]

        unless defined_group && defined_group.test(self)
          features.delete defined_group_flag.feature
        end
      end

      features
    end
  end
# Returns an array of all features rolled out to the given record.
#
# @example
#   user.detour_features
#
# @return [Array] An array of {Detour::Feature}s.
Returns an array of all features rolled out to the given record.
Returns an array of all features rolled out to the given record .
def detour_features
    @detour_features ||= begin
      features = unfiltered_features
      defined_group_flags = Detour::DefinedGroupFlag.without_opt_outs(self).where("feature_id IN (?)", features.map(&:id) << -1) 
      defined_group_flags.each do |defined_group_flag|
        defined_group = Detour::DefinedGroup.by_type(self.class)[defined_group_flag.group_name]
        unless defined_group && defined_group.test(self)
          features.delete defined_group_flag.feature
        end
      end
      features
    end
  end
def detour_features @detour_features ||= begin features = unfiltered_features defined_group_flags = Detour :: DefinedGroupFlag . without_opt_outs ( self ) . where ( "feature_id IN (?)" , features . map ( & :id ) << - 1 ) defined_group_flags . each do | defined_group_flag | defined_group = Detour :: DefinedGroup . by_type ( self . class ) [ defined_group_flag . group_name ] unless defined_group && defined_group . test ( self ) features . delete defined_group_flag . feature end end features end end
Returns an array of all features rolled out to the given record.
Returns an array of all features rolled out to the given record .
# Prevents NOT IN (NULL)
An array of {Detour::Feature}s.
An array of { Detour :: Feature } s .
Array
example
None