Class: CortexReaver::Journal
- Inherits:
-
Object
- Object
- CortexReaver::Journal
show all
- Includes:
- Model::Renderer
- Defined in:
- lib/cortex_reaver/model/journal.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#bluecloth, #erubis_filter, #macro, #render, #render_comment, #sanitize_html, #syntax_highlight
#attr_h, #errors_list, #errors_on, #form_for, #form_p, #form_submit
#delete_attachment, included
#page_navigation, #page_navigation_helper, #page_select, #subpage_navigation
Class Method Details
.atom_url ⇒ Object
20
21
22
|
# File 'lib/cortex_reaver/model/journal.rb', line 20
def self.atom_url
'/journals/atom'
end
|
.get(id) ⇒ Object
24
25
26
|
# File 'lib/cortex_reaver/model/journal.rb', line 24
def self.get(id)
self[:name => id] || self[id]
end
|
.recent ⇒ Object
28
29
30
|
# File 'lib/cortex_reaver/model/journal.rb', line 28
def self.recent
reverse_order(:created_on).limit(16)
end
|
.url ⇒ Object
32
33
34
|
# File 'lib/cortex_reaver/model/journal.rb', line 32
def self.url
'/journals'
end
|
Instance Method Details
#atom_url ⇒ Object
36
37
38
|
# File 'lib/cortex_reaver/model/journal.rb', line 36
def atom_url
'/journals/atom/' + name
end
|
#to_s ⇒ Object
44
45
46
|
# File 'lib/cortex_reaver/model/journal.rb', line 44
def to_s
title || name
end
|
#url ⇒ Object
40
41
42
|
# File 'lib/cortex_reaver/model/journal.rb', line 40
def url
'/journals/show/' + name
end
|
#validate ⇒ Object
48
49
50
51
52
53
|
# File 'lib/cortex_reaver/model/journal.rb', line 48
def validate
validates_unique :name
validates_presence :name
validates_max_length 255, :name
validates_presence :title
end
|