1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00
draper/spec/support/samples/product.rb

68 lines
907 B
Ruby
Raw Normal View History

class Product < ActiveRecord::Base
include Draper::ModelSupport
2012-01-31 05:11:55 -05:00
def self.find_by_name(name)
@@dummy ||= Product.new
end
def self.first
@@first ||= Product.new
end
def self.last
@@last ||= Product.new
end
2012-01-31 05:11:55 -05:00
def self.all
[Product.new, Product.new]
end
def self.scoped
[Product.new]
end
def self.model_name
"Product"
end
def self.find(id)
return Product.new
end
2012-01-31 05:11:55 -05:00
def self.sample_class_method
"sample class method"
end
2012-01-31 05:11:55 -05:00
def hello_world
"Hello, World"
end
2012-01-31 05:11:55 -05:00
def goodnight_moon
"Goodnight, Moon"
end
2012-01-31 05:11:55 -05:00
def title
"Sample Title"
end
2012-01-31 05:11:55 -05:00
def some_action
self.nonexistant_method
end
def block
yield
end
def self.reflect_on_association(association_symbol)
OpenStruct.new(:klass => self)
end
def similar_products
[Product.new, Product.new]
end
def previous_version
Product.new
end
end