rails fixture without timestamping
without_timestamping_of Article do
Factory(:article, :created_at => 1.week.ago, :updated_at => 1.week.ago)
end
rails fixture without timestamping
without_timestamping_of Article do
Factory(:article, :created_at => 1.week.ago, :updated_at => 1.week.ago)
end
rails fixture without timestamping
# test_helper.rb
class Test::Unit::TestCase # or class ActiveSupport::TestCase in Rails 2.3.x
def without_timestamping_of(*klasses)
if block_given?
klasses.delete_if { |klass| !klass.record_timestamps }
klasses.each { |klass| klass.record_timestamps = false }
begin
yield
ensure
klasses.each { |klass| klass.record_timestamps = true }
end
end
end
end
rails fixture without timestamping
Factory(:article, :created_at => 1.week.ago, :updated_at => 1.week.ago)
rails fixture without timestamping
without_timestamping_of Article, Comment, User do
Factory(:article, :created_at => 1.week.ago, :updated_at => 1.week.ago)
Factory(:comment, :created_at => 1.day.ago)
Factory(:user, :updated_at => 5.hours.ago)
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us