Sha256: f92b06009661c350eb0c6ae6bdebbd64f2ca0f19cc4817fb1a3109533998e6ff

Contents?: true

Size: 728 Bytes

Versions: 6

Compression:

Stored size: 728 Bytes

Contents

class Page < Content
  belongs_to :user
  validates_presence_of :name, :title, :body
  validates_uniqueness_of :name

  content_fields :body

  def self.default_order
    'name ASC'
  end

  typo_deprecate :location => :permalink_url
  
  def permalink_url(anchor=nil, only_path=true)
    blog.url_for(
      :controller => '/articles',
      :action => 'view_page',
      :name => name, 
      :anchor => anchor,
      :only_path => only_path
    )
  end

  def self.find_by_published_at
    super(:created_at)
  end


  def edit_url
    blog.url_for(:controller => "/admin/pages", :action =>"edit", :id => id)
  end
  
  def delete_url
    blog.url_for(:controller => "/admin/pages", :action =>"destroy", :id => id)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-5.0.3.98.1 app/models/page.rb
typo-5.0.3.98 app/models/page.rb
typo-5.1.1 app/models/page.rb
typo-5.1.2 app/models/page.rb
typo-5.1.3 app/models/page.rb
typo-5.1 app/models/page.rb