Sha256: 64386546699a579d342f27da49c82ef148a012209baebc6c7c588f21023d5e90

Contents?: true

Size: 671 Bytes

Versions: 4

Compression:

Stored size: 671 Bytes

Contents

class TestModel
  def to_param
    id
  end

  def id
    @id ||= TestModel.current_id += 1
  end

  def change_frequency
    'monthly'
  end

  def priority
    0.8
  end

  def updated_at
    Time.at(1000000000)
  end

  class << self
    def table_name
      'test_models'
    end

    def count_for_sitemap
      self.find_for_sitemap.size
    end

    def num_items
      10
    end

    def find_for_sitemap(options={})
      instances = []
      num_times = options.delete(:limit) || self.num_items
      num_times.times { instances.push(self.new) }
      instances
    end

    attr_writer :current_id

    def current_id
      @current_id ||= 0
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
big_sitemap-1.1.0 test/fixtures/test_model.rb
big_sitemap-1.0.2 test/fixtures/test_model.rb
big_sitemap-1.0.1 test/fixtures/test_model.rb
big_sitemap-1.0.0 test/fixtures/test_model.rb