Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
74d12b6b
Commit
74d12b6b
authored
Aug 08, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove legacy Ci::StaticModel we do not use anymore
parent
91030230
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
49 deletions
+0
-49
lib/ci/static_model.rb
lib/ci/static_model.rb
+0
-49
No files found.
lib/ci/static_model.rb
deleted
100644 → 0
View file @
91030230
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment