Class: Enki::Page
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Enki::Page
show all
- Extended by:
- PaginationShim
- Defined in:
- app/models/enki/page.rb
Class Method Summary
collapse
Instance Method Summary
collapse
paginated, paginated_pages
Class Method Details
.build_for_preview(params) ⇒ Object
15
16
17
18
19
|
# File 'app/models/enki/page.rb', line 15
def build_for_preview(params)
page = Page.new(params)
page.apply_filter
page
end
|
Instance Method Details
#active? ⇒ Boolean
26
27
28
|
# File 'app/models/enki/page.rb', line 26
def active?
true
end
|
#destroy_with_undo ⇒ Object
30
31
32
33
34
35
|
# File 'app/models/enki/page.rb', line 30
def destroy_with_undo
transaction do
self.destroy
return DeletePageUndo.create_undo(self)
end
end
|
#generate_slug ⇒ Object
37
38
39
40
|
# File 'app/models/enki/page.rb', line 37
def generate_slug
self.slug = self.title.dup if self.slug.blank?
self.slug.slugorize!
end
|