Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
class ModelWithoutDatabase
def save() raise NotImplementedError end
def save!() raise NotImplementedError end
def update_attribute() raise NotImplementedError end
def new_record?() true end
include ActiveRecord::Validations
def initialize(attributes = nil)
self.attributes = attributes
end
def attributes=(new_attributes)
return unless new_attributes
new_attributes.each do |k, v|
k = "#{k}="
send(k, v) if respond_to?(k)
end
end
end
class Foo < ModelWithoutDatabase
attr_accessor :my_attr
validates_presence_of :my_attr
end
class FooController < ApplicationController
def bar
foo = Foo.new params[:foo]
do_something if foo.valid?
end
end
|