Class: SakaiInfo::WikiPageHistory
Instance Attribute Summary
Attributes inherited from WikiPage
#dbrow
Attributes inherited from SakaiObject
#id
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from WikiPage
#content_serialization, #group_admin?, #group_readable?, #group_writable?, #history, #history_summary_serialization, #initialize, #last_updated, #last_updated_by, #owner, #owner_admin?, #owner_readable?, #owner_writable?, #page_name, #permission_string, #permissions_serialization, #public_readable?, #public_writable?, #realm, #realm_name, #revision, #site, #site_id, #summary_serialization
Methods inherited from SakaiObject
#dbrow_only_serialization, #dbrow_serialization, descendants, #object_type_serialization, #serialize, #shell_serialization, #summary_serialization, #to_csv, #to_json, #to_yaml
Class Method Details
.all_serializations ⇒ Object
280
281
282
283
284
285
286
|
# File 'lib/sakai-info/wiki.rb', line 280
def self.all_serializations
[
:default,
:permissions,
:content,
]
end
|
.clear_cache ⇒ Object
227
228
229
|
# File 'lib/sakai-info/wiki.rb', line 227
def self.clear_cache
@@cache = {}
end
|
.find_by_wiki_page_id(id) ⇒ Object
255
256
257
258
259
260
261
262
263
|
# File 'lib/sakai-info/wiki.rb', line 255
def self.find_by_wiki_page_id(id)
results = []
DB.connect[:rwikihistory].filter(:rwikiobjectid => id).
order(:revision).all.collect do |row|
@@cache[row[:id]] = WikiPageHistory.new(row)
results << @@cache[row[:id]]
end
results
end
|
Instance Method Details
#content ⇒ Object
243
244
245
|
# File 'lib/sakai-info/wiki.rb', line 243
def content
@content ||= DB.connect[:rwikihistorycontent].where(:rwikiid => self.id).first[:content].read
end
|
#default_serialization ⇒ Object
265
266
267
268
269
|
# File 'lib/sakai-info/wiki.rb', line 265
def default_serialization
result = super
result["current_version"] = self.wiki_page.serialize(:history_summary)
result
end
|
#history_serialization ⇒ Object
271
272
273
274
275
276
277
278
|
# File 'lib/sakai-info/wiki.rb', line 271
def history_serialization
{
"id" => self.id,
"revision" => self.revision,
"last_updated" => self.last_updated,
"last_updated_by" => self.last_updated_by.eid,
}
end
|
#wiki_page ⇒ Object
251
252
253
|
# File 'lib/sakai-info/wiki.rb', line 251
def wiki_page
@wiki_page ||= WikiPage.find(self.wiki_page_id)
end
|
#wiki_page_id ⇒ Object
247
248
249
|
# File 'lib/sakai-info/wiki.rb', line 247
def wiki_page_id
@dbrow[:rwikiobjectid]
end
|