2011-07-23 13:15:53 -04:00
|
|
|
class Product < ActiveRecord::Base
|
2011-10-28 08:07:03 -04:00
|
|
|
include Draper::ModelSupport
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2012-01-16 20:27:48 -05:00
|
|
|
def self.find_by_name(name)
|
|
|
|
@@dummy ||= Product.new
|
|
|
|
end
|
2011-10-28 21:02:36 -04:00
|
|
|
|
|
|
|
def self.first
|
|
|
|
@@first ||= Product.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.last
|
|
|
|
@@last ||= Product.new
|
|
|
|
end
|
2012-01-31 05:11:55 -05:00
|
|
|
|
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
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2011-10-08 22:47:08 -04:00
|
|
|
def self.sample_class_method
|
|
|
|
"sample class method"
|
|
|
|
end
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2011-07-23 13:15:53 -04:00
|
|
|
def hello_world
|
|
|
|
"Hello, World"
|
|
|
|
end
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2011-07-23 13:15:53 -04:00
|
|
|
def goodnight_moon
|
|
|
|
"Goodnight, Moon"
|
|
|
|
end
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2011-07-23 13:15:53 -04:00
|
|
|
def title
|
|
|
|
"Sample Title"
|
|
|
|
end
|
2012-01-31 05:11:55 -05:00
|
|
|
|
2012-01-31 06:03:14 -05:00
|
|
|
def some_action
|
|
|
|
self.nonexistant_method
|
|
|
|
end
|
|
|
|
|
2011-07-23 13:15:53 -04:00
|
|
|
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)
|
2012-03-07 22:23:54 -05:00
|
|
|
association_symbol.to_s.starts_with?("poro") ? nil : OpenStruct.new(:klass => self)
|
2011-12-06 14:25:26 -05:00
|
|
|
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
|
2012-03-08 08:21:26 -05:00
|
|
|
|
|
|
|
def thing
|
|
|
|
SomeThing.new
|
|
|
|
end
|
2012-03-07 22:23:54 -05:00
|
|
|
|
|
|
|
def poro_similar_products
|
|
|
|
[Product.new, Product.new]
|
|
|
|
end
|
|
|
|
|
|
|
|
def poro_previous_version
|
|
|
|
Product.new
|
|
|
|
end
|
|
|
|
|
2011-10-28 08:07:03 -04:00
|
|
|
end
|