This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cucumber/rake/task' | |
namespace :cucumber do | |
Cucumber::Rake::Task.new(:plain) do |t| | |
t.cucumber_opts = "--format pretty" | |
t.step_list = %w{features/support/env.rb features/support/plain.rb features/step_definitions} | |
t.feature_list = %w{features/plain} | |
end | |
task :plain => 'db:test:prepare' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# is it risky to trust on updated_at ? | |
# Summary: all products with no price on API should be disabled. | |
# adding a new 'updated_by_api_at' timestamp field to the products table... | |
start_time = Time.now | |
Product.transaction do | |
ProductApi.each do |e| | |
Product.find(e.code).update_attributes :price => e.price, :updated_by_api_at = Time.now | |
end |