search for: my_record

Displaying 2 results from an estimated 2 matches for "my_record".

Did you mean: mf_record
2005 Dec 17
2
Storing an object in the db
...39;ve asked this before, but never got a working response. I''d like to store an object inside a binary field in my db. So I''d have a class like this class MyAwesomeClass def do_something_awesome ... end end then class MyRecord < ActiveRecord::Base end the table my_record would have a binary field, my_object, that would store an object of MyAwesomeClass. So I could do: r = MyRecord.new r.my_object = MyAwesomeClass.new r.reload r.my_object.do_something_awesome I saw that there''s a serialize helper, where I''d put this in my AR class: class MyRecord...
2007 Aug 24
26
testing behaviour or testing code?
hypothetical question for all you BDD experts: I want to make sure that a :list action always returns widgets in alphabetical order. There''s at least 2 ways of doing this: it "should fetch items in alphabetical order" do Widget.should_receive(:find).with(:order => "name ASC") get :list end it "should fetch items in alphabetical order" do [:red,