Commit dab5e045 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix/remove-legacy-ci-static-model' into 'master'

Remove legacy Ci::StaticModel we do not use anymore

## What does this MR do?

This removes class that according to our code coverage report and
`grep` is a legacy and unused class.

See merge request !5710
parents 900c67bf 74d12b6b
# Provides an ActiveRecord-like interface to a model whose data is not persisted to a database.
module Ci
module StaticModel
extend ActiveSupport::Concern
module ClassMethods
# Used by ActiveRecord's polymorphic association to set object_id
def primary_key
'id'
end
# Used by ActiveRecord's polymorphic association to set object_type
def base_class
self
end
end
# Used by AR for fetching attributes
#
# Pass it along if we respond to it.
def [](key)
send(key) if respond_to?(key)
end
def to_param
id
end
def new_record?
false
end
def persisted?
false
end
def destroyed?
false
end
def ==(other)
if other.is_a? ::Ci::StaticModel
id == other.id
else
super
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment