2011-07-23 17:15:53 +00:00
|
|
|
class Product < ActiveRecord::Base
|
2011-10-28 12:07:03 +00:00
|
|
|
include Draper::ModelSupport
|
2011-10-29 01:02:36 +00:00
|
|
|
|
|
|
|
def self.first
|
|
|
|
@@first ||= Product.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.last
|
|
|
|
@@last ||= Product.new
|
|
|
|
end
|
2011-10-29 00:38:43 +00:00
|
|
|
|
|
|
|
def self.all
|
|
|
|
[Product.new, Product.new]
|
|
|
|
end
|
2011-10-28 12:07:03 +00:00
|
|
|
|
|
|
|
def self.scoped
|
|
|
|
[Product.new]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.model_name
|
|
|
|
"Product"
|
|
|
|
end
|
|
|
|
|
2011-07-23 17:15:53 +00:00
|
|
|
def self.find(id)
|
|
|
|
return Product.new
|
|
|
|
end
|
|
|
|
|
2011-10-09 02:47:08 +00:00
|
|
|
def self.sample_class_method
|
|
|
|
"sample class method"
|
|
|
|
end
|
|
|
|
|
2011-07-23 17:15:53 +00:00
|
|
|
def hello_world
|
|
|
|
"Hello, World"
|
|
|
|
end
|
|
|
|
|
|
|
|
def goodnight_moon
|
|
|
|
"Goodnight, Moon"
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
|
|
|
"Sample Title"
|
|
|
|
end
|
|
|
|
|
|
|
|
def block
|
|
|
|
yield
|
|
|
|
end
|
2011-11-18 23:24:03 +00:00
|
|
|
|
2011-12-06 19:25:26 +00:00
|
|
|
def self.reflect_on_association(association_symbol)
|
|
|
|
OpenStruct.new(:klass => self)
|
|
|
|
end
|
|
|
|
|
2011-11-18 23:24:03 +00:00
|
|
|
def similar_products
|
2011-12-06 19:25:26 +00:00
|
|
|
[Product.new, Product.new]
|
2011-11-18 23:24:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def previous_version
|
|
|
|
Product.new
|
|
|
|
end
|
2011-10-28 12:07:03 +00:00
|
|
|
end
|