Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
53165359
Commit
53165359
authored
13 years ago
by
Felix Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
Touch journaled objects on journal creation only. #543
parent
55f9ecbe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/journal.rb
+8
-1
8 additions, 1 deletion
app/models/journal.rb
with
8 additions
and
1 deletion
app/models/journal.rb
+
8
−
1
View file @
53165359
...
...
@@ -28,9 +28,12 @@ class Journal < ActiveRecord::Base
# subclasses will be given an actual class name when they are created by aaj
#
# e.g. IssueJournal will get :class_name => 'Issue'
belongs_to
:journaled
,
:touch
=>
true
,
:class_name
=>
'Journal'
belongs_to
:journaled
,
:class_name
=>
'Journal'
belongs_to
:user
# "touch" the journaled object on creation
after_create
:touch_journaled_after_creation
# ActiveRecord::Base#changes is an existing method, so before serializing the +changes+ column,
# the existing +changes+ method is undefined. The overridden +changes+ method pertained to
# dirty attributes, but will not affect the partial updates functionality as that's based on
...
...
@@ -38,6 +41,10 @@ class Journal < ActiveRecord::Base
# undef_method :changes
serialize
:changes
,
Hash
def
touch_journaled_after_creation
journaled
.
touch
end
# In conjunction with the included Comparable module, allows comparison of journal records
# based on their corresponding version numbers, creation timestamps and IDs.
def
<
=>
(
other
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment