Displaying 4 results from an estimated 4 matches for "valid_until".
2007 Feb 13
7
Specs of code that use Time.now
Hi
Just trying to spec a Rails model that defaults a valid_until date to
this time tomorrow. I''ve done something similar involving Dates, and
you can stub the :today method to return something fixed. But when I
tried this with Time, I found that RSpec calls Time.now four times
per spec. So there''s no way to spec code like 1.days.from...
2013 Jul 14
2
Rails 4: Session Expiry?
I''ve been Googling this question for the past few hours, and I think it''s
time I simply ask this question myself.
I just made the switch from Rails 3.2 to Rails 4. I''m trying to make sure
I''m as up-to-speed as possible on security issues, and I''m concerned about
sessions right now. It looks like Rails 4 has moved away from supporting
really
2007 Jul 24
11
Mock or Stub strategy for validates_uniqueness_of
Hi,
I''m a bit stuck with mocking a unit test of a join model with regards to a
validates_uniqueness_of clause.
I have
class Book < AR:B
has_many :clippings
various validates_presence_of etc
end
class Clip < AR:B
has_many :clippings
various validates_presence_of etc
end
class Clipping < AR:B
belongs_to :book
belongs_to :clip
validates_uniqueness_of :clip_id,
2006 Mar 29
1
schema dump corrupts date defaults in mysql
...is known, or if you can confirm.
Just upped to Rails 1.1. When I run `rake test` I get:
rake aborted!
./db/schema.rb:17: parse error, unexpected kEND
./db/schema.rb:21: parse error, unexpected $, expecting kEND
(See full trace by running task with --trace)
Uggly. In schema.rb:
t.column "valid_until", :date, :default => #<Date: 4976867/2,0,2299161>
Whoa, an object ID? that can''t be right....and if I change schema.rb to a
string, rake re-writes the damn thing before running the tests anyway. Is
this confirmed/disprooved? Is it something I may be doing wrong?
The rake...