2011-07-23 13:15:53 -04:00
|
|
|
class Product < ActiveRecord::Base
|
2011-10-28 08:07:03 -04:00
|
|
|
include Draper::ModelSupport
|
2011-10-28 21:02:36 -04:00
|
|
|
|
|
|
|
def self.first
|
|
|
|
@@first ||= Product.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.last
|
|
|
|
@@last ||= Product.new
|
|
|
|
end
|
2011-10-28 20:38:43 -04:00
|
|
|
|
|
|
|
def self.all
|
|
|
|
[Product.new, Product.new]
|
|
|
|
end
|
2011-10-28 08:07:03 -04:00
|
|
|
|
|
|
|
def self.scoped
|
|
|
|
[Product.new]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.model_name
|
|
|
|
"Product"
|
|
|
|
end
|
|
|
|
|
2011-07-23 13:15:53 -04:00
|
|
|
def self.find(id)
|
|
|
|
return Product.new
|
|
|
|
end
|
|
|
|
|
2011-10-08 22:47:08 -04:00
|
|
|
def self.sample_class_method
|
|
|
|
"sample class method"
|
|
|
|
end
|
|
|
|
|
2011-07-23 13:15:53 -04: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 18:24:03 -05:00
|
|
|
|
2011-12-06 14:25:26 -05:00
|
|
|
def self.reflect_on_association(association_symbol)
|
|
|
|
OpenStruct.new(:klass => self)
|
|
|
|
end
|
|
|
|
|
2011-11-18 18:24:03 -05:00
|
|
|
def similar_products
|
2011-12-06 14:25:26 -05:00
|
|
|
[Product.new, Product.new]
|
2011-11-18 18:24:03 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def previous_version
|
|
|
|
Product.new
|
|
|
|
end
|
2011-10-28 08:07:03 -04:00
|
|
|
end
|