require "active_model"

class Customer < Struct.new(:name, :id)
  extend ActiveModel::Naming
  include ActiveModel::Conversion

  undef_method :to_json

  def to_xml(options={})
    if options[:builder]
      options[:builder].name name
    else
      "<name>#{name}</name>"
    end
  end

  def to_js(options={})
    "name: #{name.inspect}"
  end
  alias :to_text :to_js

  def errors
    []
  end

  def persisted?
    id.present?
  end
end

class BadCustomer < Customer
end

class GoodCustomer < Customer
end
require "active_model"

class Customer < Struct.new(:name, :id)
  extend ActiveModel::Naming
  include ActiveModel::Conversion
end

class BadCustomer < Customer
end

class GoodCustomer < Customer
end
Remove more un-needed code from the fake Customer
Remove more un-needed code from the fake Customer

Remove more un-needed code from the Customer which came from the ActionPack
tests
