fix wiki content specs
This commit is contained in:
parent
68ca0636c4
commit
d1ba27358a
@ -53,6 +53,20 @@ class WikiContent < ActiveRecord::Base
|
|||||||
notified.collect(&:mail)
|
notified.collect(&:mail)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# FIXME: Deprecate
|
||||||
|
def versions
|
||||||
|
journals
|
||||||
|
end
|
||||||
|
|
||||||
|
def version
|
||||||
|
unless last_journal
|
||||||
|
# FIXME: This is code that caters for a case that should never happen in the normal code paths!!
|
||||||
|
create_journal
|
||||||
|
last_journal.update_attribute(:created_at, updated_on)
|
||||||
|
end
|
||||||
|
last_journal.version
|
||||||
|
end
|
||||||
|
|
||||||
# FIXME: This is for backwards compatibility only. Remove once we decide it is not needed anymore
|
# FIXME: This is for backwards compatibility only. Remove once we decide it is not needed anymore
|
||||||
WikiContentJournal.class_eval do
|
WikiContentJournal.class_eval do
|
||||||
attr_protected :data
|
attr_protected :data
|
||||||
@ -104,19 +118,5 @@ class WikiContent < ActiveRecord::Base
|
|||||||
def versioned
|
def versioned
|
||||||
journaled
|
journaled
|
||||||
end
|
end
|
||||||
|
|
||||||
# FIXME: Deprecate
|
|
||||||
def versions
|
|
||||||
journals
|
|
||||||
end
|
|
||||||
|
|
||||||
def version
|
|
||||||
unless last_journal
|
|
||||||
# FIXME: This is code that caters for a case that should never happen in the normal code paths!!
|
|
||||||
update_journal
|
|
||||||
last_journal.update_attribute(:created_at, updated_on)
|
|
||||||
end
|
|
||||||
last_journal.version
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user