cartodb/app/models/carto/feature_flag.rb
2020-06-15 10:58:47 +08:00

14 lines
283 B
Ruby

module Carto
class FeatureFlag < ActiveRecord::Base
validates :name, presence: true
has_many :feature_flags_user, dependent: :destroy
def self.find_by_user(user)
FeatureFlag.where(restricted: false) + user.feature_flags.select(&:restricted)
end
end
end