Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
296db927
Commit
296db927
authored
Feb 12, 2013
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't set YAML on serialized fields #1233
parent
3eae0584
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
issue.rb
app/models/issue.rb
+1
-1
wiki_content.rb
app/models/wiki_content.rb
+1
-1
20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb
...d_changes_from_journal_details_for_acts_as_journalized.rb
+1
-1
20100804112053_merge_wiki_versions_with_journals.rb
...grate/20100804112053_merge_wiki_versions_with_journals.rb
+1
-1
test_helper.rb
test/test_helper.rb
+2
-2
No files found.
app/models/issue.rb
View file @
296db927
...
...
@@ -364,7 +364,7 @@ class Issue < ActiveRecord::Base
def
attachment_removed
(
obj
)
init_journal
(
User
.
current
)
create_journal
last_journal
.
update_attribute
(
:changes
,
{
"attachments_"
+
obj
.
id
.
to_s
=>
[
obj
.
filename
,
nil
]}
.
to_yaml
)
last_journal
.
update_attribute
(
:changes
,
{
"attachments_"
+
obj
.
id
.
to_s
=>
[
obj
.
filename
,
nil
]})
end
# Return true if the issue is closed, otherwise false
...
...
app/models/wiki_content.rb
View file @
296db927
...
...
@@ -98,7 +98,7 @@ class WikiContent < ActiveRecord::Base
changes
.
delete
(
"text"
)
changes
[
"data"
]
=
hash
[
:text
]
changes
[
"compression"
]
=
hash
[
:compression
]
update_attribute
(
:changes
,
changes
.
to_yaml
)
update_attribute
(
:changes
,
changes
)
end
def
text
...
...
db/migrate/20100714111654_add_changes_from_journal_details_for_acts_as_journalized.rb
View file @
296db927
...
...
@@ -31,7 +31,7 @@ class AddChangesFromJournalDetailsForActsAsJournalized < ActiveRecord::Migration
changes
[
"attachments_"
+
detail
.
prop_key
.
to_s
]
=
[
detail
.
old_value
,
detail
.
value
]
end
begin
journal
.
update_attribute
(
:changes
,
changes
.
to_yaml
)
journal
.
update_attribute
(
:changes
,
changes
)
rescue
ActiveRecord
::
RecordInvalid
=>
ex
puts
"Error saving:
#{
journal
.
class
.
to_s
}
#
#{
journal
.
id
}
-
#{
ex
.
message
}
"
end
...
...
db/migrate/20100804112053_merge_wiki_versions_with_journals.rb
View file @
296db927
...
...
@@ -37,7 +37,7 @@ class MergeWikiVersionsWithJournals < ActiveRecord::Migration
changes
=
{}
changes
[
"compression"
]
=
wv
.
compression
changes
[
"data"
]
=
wv
.
data
journal
.
update_attribute
(
:changes
,
changes
.
to_yaml
)
journal
.
update_attribute
(
:changes
,
changes
)
journal
.
update_attribute
(
:version
,
wv
.
version
)
end
# drop_table :wiki_content_versions
...
...
test/test_helper.rb
View file @
296db927
...
...
@@ -168,14 +168,14 @@ class ActiveSupport::TestCase
should
"use the new value's name"
do
@detail
=
IssueJournal
.
generate
(
:version
=>
1
,
:journaled
=>
Issue
.
last
)
@detail
.
update_attribute
(
:changes
,
{
prop_key
=>
[
@old_value
.
id
,
@new_value
.
id
]}
.
to_yaml
)
@detail
.
update_attribute
(
:changes
,
{
prop_key
=>
[
@old_value
.
id
,
@new_value
.
id
]})
assert_match
@new_value
.
class
.
find
(
@new_value
.
id
).
name
,
@detail
.
render_detail
(
prop_key
,
true
)
end
should
"use the old value's name"
do
@detail
=
IssueJournal
.
generate
(
:version
=>
1
,
:journaled
=>
Issue
.
last
)
@detail
.
update_attribute
(
:changes
,
{
prop_key
=>
[
@old_value
.
id
,
@new_value
.
id
]}
.
to_yaml
)
@detail
.
update_attribute
(
:changes
,
{
prop_key
=>
[
@old_value
.
id
,
@new_value
.
id
]})
assert_match
@old_value
.
class
.
find
(
@old_value
.
id
).
name
,
@detail
.
render_detail
(
prop_key
,
true
)
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