1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/lib/controller/fake_models.rb
Yehuda Katz 5ffaaa71d1 Define ActiveModel API Compliance
- Define to_model on AR
  - Define to_model on ActiveModel::APICompliant
  - Update test fixtures to be API Compliant
  - Start using to_model in AP
2009-07-20 00:27:04 +09:00

25 lines
348 B
Ruby

require "active_model"
class Customer < Struct.new(:name, :id)
extend ActiveModel::APICompliant
def to_param
id.to_s
end
end
class BadCustomer < Customer
end
class GoodCustomer < Customer
end
module Quiz
class Question < Struct.new(:name, :id)
extend ActiveModel::APICompliant
def to_param
id.to_s
end
end
end