test/fixtures/test_model.rb in big_sitemap-0.5.1 vs test/fixtures/test_model.rb in big_sitemap-0.8.1
- old
+ new
@@ -1,10 +1,14 @@
class TestModel
def to_param
- object_id
+ id #|| object_id
end
+ def id
+ @id ||= TestModel.current_id += 1
+ end
+
def change_frequency
'monthly'
end
def priority
@@ -14,10 +18,14 @@
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
@@ -27,8 +35,14 @@
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
\ No newline at end of file