From 3eff5bfa0c33e23779c637393d2dcacd237ddf69 Mon Sep 17 00:00:00 2001 From: Andrew Cantino Date: Sun, 24 Mar 2013 20:19:01 -0700 Subject: [PATCH] fix db:seed --- app/models/agents/weather_agent.rb | 2 +- db/seeds.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/agents/weather_agent.rb b/app/models/agents/weather_agent.rb index eb3649d7..6fae46b4 100644 --- a/app/models/agents/weather_agent.rb +++ b/app/models/agents/weather_agent.rb @@ -61,7 +61,7 @@ module Agents def validate_options errors.add(:base, "zipcode is required") unless options[:zipcode].present? - errors.add(:base, "api_key is required") unless key_setup? + errors.add(:base, "api_key is required") unless options[:api_key].present? end def check diff --git a/db/seeds.rb b/db/seeds.rb index 49bf4eb4..a22f5f7c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -13,7 +13,7 @@ unless user.agents.where(:name => "SF Weather Agent").exists? Agent.build_for_type("Agents::WeatherAgent", user, :name => "SF Weather Agent", :schedule => "10pm", - :options => {:zipcode => "94103"}).save! + :options => { :zipcode => "94103", :api_key => "your-key" }).save! end unless user.agents.where(:name => "XKCD Source").exists?