Displaying 2 results from an estimated 2 matches for "acitverecord".
2006 Jan 09
5
Formatting timestamp objects
...date.hour
end
time = "#{hour}:#{date.min} "
if date.hour > 12
time += "pm"
else
time += "am"
end
end
There has to be a better way to do this. Any ideas?
BTW - How do I know what the datatype of the properties that are created by
AcitveRecord::Base are?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/1ac9a437/attachment.html
2007 Feb 22
7
We can''t 100% remove our unit tests from the database, can we?
I hope this isn''t too rambly. This is sort of a brain dump of a
subject I''ve been thinking about for months as I''ve used RSpec.
Let''s say we''ve got a simple query method, that will find all the
users in the DB older than 18. Our model could look like
class User < ActiveRecord::Base
def self.find_older_than(age)
find :all, :conditions =>