The Depot Application
6.5 Iteration A4: Making Prettier Listings
6.3 Iteration A2: Add a Missing Column
6.4 Iteration A3: Validate!
</3 errors prohibited this product from being saved/> expected but was
<"6.4 Iteration A3: Validate!">.
Traceback:
/home/rubys/git/awdwr/edition3/work-192-23/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb:307:in `assert_select'
/home/rubys/git/awdwr/edition3/checkdepot.rb:74:in `block in <class:DepotTest>'
edit app/models/product.rb
class Product < ActiveRecord::Base
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
validate :price_must_be_at_least_a_cent
validates_uniqueness_of :title
validates_format_of :image_url, :allow_blank => true,
:with => %r{\.(gif|jpg|png)$}i,
:message => 'must be a URL for GIF, JPG ' +
'or PNG image.'
protected
def price_must_be_at_least_a_cent
errors.add(:price, 'should be at least 0.01') if price.nil? ||
price < 0.00
end
end
get /products/new
ActiveRecord::StatementInvalid
in ProductsController#new
Could not find table 'products'
RAILS_ROOT: /home/rubys/git/awdwr/edition3/work-192-23/depot
Application Trace |
Framework Trace |
Full Trace
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/head.rb:9:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:47:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `each'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/content_length.rb:13:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/handler/webrick.rb:48:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/head.rb:9:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:47:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `each'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/content_length.rb:13:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/handler/webrick.rb:48:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Cache-Control"=>"no-cache",
"Content-Type"=>""}
get /products/new
ActiveRecord::StatementInvalid
in ProductsController#new
Could not find table 'products'
RAILS_ROOT: /home/rubys/git/awdwr/edition3/work-192-23/depot
Application Trace |
Framework Trace |
Full Trace
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/head.rb:9:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:47:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `each'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/content_length.rb:13:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/handler/webrick.rb:48:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `block in table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `columns'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:3067:in `attributes_from_column_definition'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition_with_lock'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/base.rb:2473:in `initialize'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/app/controllers/products_controller.rb:27:in `new'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/head.rb:9:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in `run'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:47:in `block in call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `each'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/urlmap.rb:41:in `call'
/home/rubys/git/awdwr/edition3/work-192-23/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/content_length.rb:13:in `call'
/home/rubys/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.1.3/lib/rack/handler/webrick.rb:48:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Cache-Control"=>"no-cache",
"Content-Type"=>""}
edit app/models/product.rb
class Product < ActiveRecord::Base
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
validate :price_must_be_at_least_a_cent
validates_uniqueness_of :title
validates_format_of :image_url,
:with => %r{\.(gif|jpg|png)$}i,
:message => 'must be a URL for GIF, JPG ' +
'or PNG image.'
protected
def price_must_be_at_least_a_cent
errors.add(:price, 'should be at least 0.01') if price.nil? ||
price < 0.01
end
end
6.5 Iteration A4: Making Prettier Listings
6.3 Iteration A2: Add a Missing Column