Sha256: 2cbcc3b74c12ac55b5771c9ca97bfb46fb59db486627593421542a45abb1f0bf

Contents?: true

Size: 689 Bytes

Versions: 12

Compression:

Stored size: 689 Bytes

Contents

# This model is not actually backed by the database, but conveniently collects all the changelog entries as models

require 'will_paginate/array' # because model not backed by database, model returns arrays instead of ActiveRecord Relations

class Changelog < ActiveRecord::Base
  attr_accessor :title, :content
  def initialize(title,content)
    @title = title
    @content = content
  end
  def self.all
    changelogs = IO.read(File.expand_path("../../../../../CHANGELOG.md",__FILE__)).split(/^## /).map{|str| Changelog.new(str.split(/$/,2)[0],str.split(/$/,2)[1])}
    changelogs.slice!(0)
    changelogs
  end
  def self.paginate(options={})
    self.all.paginate(options)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ajax_pagination-0.6.5 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.6.4 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.6.3 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.6.2 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.6.1 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.6.0 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.5.1 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.5.0 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.4.0 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.3.0 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.2.0 spec/rails_app/app/models/changelog.rb
ajax_pagination-0.1.0 spec/rails_app/app/models/changelog.rb