Closed GoogleCodeExporter closed 9 years ago
I cannot reproduce this.
Would be usefull if you put a full stack trace and describe it better, what OS,
what
type of image.
Original comment by edmundo...@gmail.com
on 1 Mar 2008 at 3:55
ActiveRecord::AssociationTypeMismatch (Image expected, got Image):
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:1
50:in
`raise_on_type_mismatch'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:57:in
`<<'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:56:in
`each'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:56:in
`<<'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/databa
se_statements.rb:66:in
`transaction'
/vendor/rails/activerecord/lib/active_record/transactions.rb:80:in `transaction'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:55:in
`<<'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:100:in `save'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:94:in `each'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:94:in `save'
/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib64/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
/vendor/rails/actionpack/lib/action_controller/caching.rb:678:in `perform_action'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_
cache.rb:33:in
`cache'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching.rb:677:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:76:in
`process'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in
`synchronize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in
`process'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
/vendor/rails/railties/lib/commands/server.rb:39
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
./script/server:3
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in
`debug_load'
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in `main'
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/bin/rdebug-ide:74
/usr/bin/rdebug-ide:16:in `load'
/usr/bin/rdebug-ide:16
Rendering
/home/alosix/projects/ruby/substruct/vendor/rails/actionpack/lib/action_controll
er/templates/rescues/layout.erb
(internal_server_error)
Attempting to copy plugin assets from
'/home/alosix/projects/ruby/substruct/vendor/plugins/substruct/assets' to
'/home/alosix/projects/ruby/substruct/public/plugin_assets'
[4;36;1mSQL (0.000081)[0m [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.000048)[0m [0mSET SQL_AUTO_IS_NULL=0[0m
[4;36;1mPreference Columns (0.000455)[0m [0;1mSHOW FIELDS FROM `preferences`[0m
[4;35;1mPreference Load (0.000343)[0m [0mSELECT * FROM `preferences` WHERE
(`preferences`.`name` = 'mail_host') LIMIT 1[0m
[4;36;1mPreference Load (0.000184)[0m [0;1mSELECT * FROM `preferences` WHERE
(`preferences`.`name` = 'mail_port') LIMIT 1[0m
[4;35;1mPreference Load (0.000138)[0m [0mSELECT * FROM `preferences` WHERE
(`preferences`.`name` = 'mail_auth_type') LIMIT 1[0m
[4;36;1mPreference Load (0.000130)[0m [0;1mSELECT * FROM `preferences` WHERE
(`preferences`.`name` = 'mail_username') LIMIT 1[0m
[4;35;1mPreference Load (0.000132)[0m [0mSELECT * FROM `preferences` WHERE
(`preferences`.`name` = 'mail_password') LIMIT 1[0m
[4;36;1mSQL (0.036344)[0m [0;1mDELETE FROM sessions[0m
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing ProductsController#edit (for 127.0.0.1 at 2008-03-14 06:58:16) [GET]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"action"=>"edit", "id"=>"3", "controller"=>"admin/products"}
[4;35;1mTag Load (0.000229)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mOrderUser Load (0.000124)[0m [0;1mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
Redirected to http://localhost:3000/accounts/login
Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0x2b405948c0c8
@filter=:login_required>] rendered_or_redirected.
Completed in 0.00182 (549 reqs/sec) | DB: 0.08573 (4710%) | 302 Found
[http://localhost/admin/products/edit/3]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing AccountsController#login (for 127.0.0.1 at 2008-03-14 06:58:16) [GET]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"action"=>"login", "controller"=>"accounts"}
[4;35;1mTag Load (0.000216)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mOrderUser Load (0.000111)[0m [0;1mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
Rendering template within layouts/accounts
Rendering accounts/login
Completed in 0.00514 (194 reqs/sec) | Rendering: 0.00380 (73%) | DB: 0.00033
(6%) |
200 OK [http://localhost/accounts/login]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
checking plugin 'engines' for 'content_filesystem_controller'
checking plugin 'active_merchant' for 'content_filesystem_controller'
checking plugin 'acts_as_tree' for 'content_filesystem_controller'
checking plugin 'app_config' for 'content_filesystem_controller'
checking plugin 'ar_fixtures' for 'content_filesystem_controller'
checking plugin 'attachment_fu' for 'content_filesystem_controller'
checking plugin 'substruct' for 'content_filesystem_controller'
checking plugin 'will_paginate' for 'content_filesystem_controller'
loading from application: content_filesystem_controller
checking plugin 'engines' for 'content_filesystem_helper'
checking plugin 'active_merchant' for 'content_filesystem_helper'
checking plugin 'acts_as_tree' for 'content_filesystem_helper'
checking plugin 'app_config' for 'content_filesystem_helper'
checking plugin 'ar_fixtures' for 'content_filesystem_helper'
checking plugin 'attachment_fu' for 'content_filesystem_helper'
checking plugin 'substruct' for 'content_filesystem_helper'
checking plugin 'will_paginate' for 'content_filesystem_helper'
loading from application: content_filesystem_helper
Processing ContentFilesystemController#show (for 127.0.0.1 at 2008-03-14
06:58:16) [GET]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"anything"=>["plugin_assets", "substruct", "stylesheets",
"substruct.css"], "action"=>"show", "controller"=>"content_filesystem"}
[4;35;1mTag Load (0.000710)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mOrderUser Load (0.000089)[0m [0;1mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
Rendering template within layouts/main
Rendering /mnt/Alfresco/www--jpowers/HEAD/DATA/www/avm_webapps/ROOT/404.html
Completed in 0.04335 (23 reqs/sec) | Rendering: 0.01849 (42%) | DB: 0.00080
(1%) |
200 OK [http://localhost/plugin_assets/substruct/stylesheets/substruct.css]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing AccountsController#login (for 127.0.0.1 at 2008-03-14 06:58:21)
[POST]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"user_login"=>"admin", "action"=>"login", "controller"=>"accounts",
"user_password"=>"admin", "login"=>"Login"}
[4;35;1mTag Load (0.000227)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mOrderUser Load (0.000139)[0m [0;1mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
[4;35;1mUser Load (0.000277)[0m [0mSELECT * FROM `users` WHERE (login =
'admin' AND password = '652b1b54a914207f0cfd15de1967d8ebe26c1b94') LIMIT 1[0m
Redirected to http://localhost:3000/admin/products/edit/3
Completed in 0.00429 (232 reqs/sec) | DB: 0.00064 (14%) | 302 Found
[http://localhost/accounts/login]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing ProductsController#edit (for 127.0.0.1 at 2008-03-14 06:58:21) [GET]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"action"=>"edit", "id"=>"3", "controller"=>"admin/products"}
[4;36;1mTag Load (0.000243)[0m [0;1mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;35;1mOrderUser Load (0.001055)[0m [0mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
[4;36;1mUser Load (0.000151)[0m [0;1mSELECT * FROM `users` WHERE (`users`.`id`
= 1) [0m
[4;35;1mJoin Table Columns (0.000447)[0m [0mSHOW FIELDS FROM `roles_users`[0m
[4;36;1mRole Load (0.000412)[0m [0;1mSELECT * FROM `roles` INNER JOIN
roles_users ON roles.id = roles_users.role_id WHERE (roles_users.user_id = 1 )
ORDER
BY name ASC[0m
[4;35;1mJoin Table Columns (0.000370)[0m [0mSHOW FIELDS FROM `rights_roles`[0m
[4;36;1mRight Load (0.000294)[0m [0;1mSELECT * FROM `rights` INNER JOIN
rights_roles ON rights.id = rights_roles.right_id WHERE (rights_roles.role_id =
1 )
ORDER BY name ASC[0m
[AUTH] content_nodes - *
[AUTH] files - *
[AUTH] orders - *
[AUTH] preferences - *
[AUTH] products - *
[4;35;1mCACHE (0.000000)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS NULL
OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mProduct Load (0.000273)[0m [0;1mSELECT * FROM `items` WHERE
(`items`.`id` = 3) AND ( (`items`.`type` = 'Product' ) ) [0m
[4;35;1mImage Columns (0.000745)[0m [0mSHOW FIELDS FROM `user_uploads`[0m
Rendering template within layouts/admin
Rendering admin/products/edit
[4;36;1mSQL (0.000297)[0m [0;1mSELECT count(*) AS count_all FROM `items` WHERE
(items.product_id = 3) AND ( (`items`.`type` = 'Variation' ) ) [0m
[4;35;1mImage Load (0.000377)[0m [0mSELECT user_uploads.* FROM user_uploads
INNER JOIN product_images ON user_uploads.id = product_images.image_id WHERE
((product_images.product_id = 3)) AND ( (`user_uploads`.`type` = 'Image' ) )
ORDER BY
-product_images.rank DESC[0m
Rendered /shared/_multiple_upload (0.00050)
Rendered admin/products/_form (0.00646)
[4;36;1mJoin Table Columns (0.000435)[0m [0;1mSHOW FIELDS FROM `products_tags`[0m
[4;35;1mTag Load (0.000200)[0m [0mSELECT * FROM `tags` INNER JOIN
products_tags ON tags.id = products_tags.tag_id WHERE (products_tags.product_id
= 3
) [0m
[4;36;1mTag Load (0.000141)[0m [0;1mSELECT * FROM `tags` WHERE (tags.parent_id
= 1) ORDER BY -rank DESC[0m
Rendered admin/products/_tag_list_form_row (0.00245)
[4;35;1mJoin Table Columns (0.000337)[0m [0mSHOW FIELDS FROM
`related_products`[0m
[4;36;1mProduct Load (0.000204)[0m [0;1mSELECT * FROM `items` INNER JOIN
related_products ON items.id = related_products.related_id WHERE
(related_products.product_id = 3 ) AND ( (`items`.`type` = 'Product' ) ) [0m
Rendered admin/products/_relative (0.00050)
Rendered admin/products/_relative (0.00040)
Rendered admin/products/_relative (0.00041)
Rendered admin/products/_relative (0.00040)
Rendered admin/products/_relative (0.00042)
Rendered admin/products/_crud_right (0.00722)
[4;35;1mCACHE (0.000000)[0m [0mSELECT * FROM `users` WHERE (`users`.`id` = 1) [0m
Completed in 0.03369 (29 reqs/sec) | Rendering: 0.01704 (50%) | DB: 0.00598
(17%) |
200 OK [http://localhost/admin/products/edit/3]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing ProductsController#suggestion_js (for 127.0.0.1 at 2008-03-14
06:58:21) [GET]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"action"=>"suggestion_js", "controller"=>"admin/products"}
[4;36;1mTag Load (0.000295)[0m [0;1mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;35;1mOrderUser Load (0.000178)[0m [0mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
[4;36;1mUser Load (0.000220)[0m [0;1mSELECT * FROM `users` WHERE (`users`.`id`
= 1) [0m
[4;35;1mJoin Table Columns (0.000628)[0m [0mSHOW FIELDS FROM `roles_users`[0m
[4;36;1mRole Load (0.000643)[0m [0;1mSELECT * FROM `roles` INNER JOIN
roles_users ON roles.id = roles_users.role_id WHERE (roles_users.user_id = 1 )
ORDER
BY name ASC[0m
[4;35;1mJoin Table Columns (0.000594)[0m [0mSHOW FIELDS FROM `rights_roles`[0m
[4;36;1mRight Load (0.000460)[0m [0;1mSELECT * FROM `rights` INNER JOIN
rights_roles ON rights.id = rights_roles.right_id WHERE (rights_roles.role_id =
1 )
ORDER BY name ASC[0m
[AUTH] content_nodes - *
[AUTH] files - *
[AUTH] orders - *
[AUTH] preferences - *
[AUTH] products - *
[4;35;1mCACHE (0.000000)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS NULL
OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mProduct Load (0.000351)[0m [0;1mSELECT * FROM `items` WHERE (
(`items`.`type` = 'Product' ) ) [0m
Rendering admin/products/suggestion_js
Completed in 0.01065 (93 reqs/sec) | Rendering: 0.00202 (18%) | DB: 0.00337
(31%) |
200 OK [http://localhost/admin/products/suggestion_js]
checking plugin 'engines' for 'application_helper'
checking plugin 'active_merchant' for 'application_helper'
checking plugin 'acts_as_tree' for 'application_helper'
checking plugin 'app_config' for 'application_helper'
checking plugin 'ar_fixtures' for 'application_helper'
checking plugin 'attachment_fu' for 'application_helper'
checking plugin 'substruct' for 'application_helper'
==> loading from plugin 'substruct'
checking plugin 'will_paginate' for 'application_helper'
(file not found in application)
Processing ProductsController#save (for 127.0.0.1 at 2008-03-14 06:58:41) [POST]
Session ID: b2c00ec704843af5dc28c45cf56e38c8
Parameters: {"commit"=>"Save This Product", "product"=>{"name"=>"some other
product", "size_width"=>"0", "weight"=>"0", "code"=>"88889", "price"=>"88",
"tags"=>[""], "quantity"=>"88", "date_available(1i)"=>"2008",
"size_height"=>"0",
"description"=>"", "date_available(2i)"=>"3", "date_available(3i)"=>"14",
"is_discontinued"=>"0", "related_product_ids"=>["", "", "", "", ""],
"size_depth"=>"0"}, "action"=>"save", "id"=>"3", "controller"=>"admin/products",
"image"=>[{"image_data_temp"=>"",
"image_data"=>#<ActionController::UploadedStringIO:0x2b405908cae0>},
{"image_data_temp"=>"", "image_data"=>""}]}
[4;35;1mTag Load (0.000179)[0m [0mSELECT * FROM `tags` WHERE (parent_id IS
NULL OR parent_id = 0) ORDER BY -rank DESC[0m
[4;36;1mOrderUser Load (0.000087)[0m [0;1mSELECT * FROM `order_users` WHERE
(`order_users`.`id` IS NULL) LIMIT 1[0m
[4;35;1mUser Load (0.000103)[0m [0mSELECT * FROM `users` WHERE (`users`.`id`
= 1) [0m
[4;36;1mJoin Table Columns (0.000372)[0m [0;1mSHOW FIELDS FROM `roles_users`[0m
[4;35;1mRole Load (0.000345)[0m [0mSELECT * FROM `roles` INNER JOIN
roles_users ON roles.id = roles_users.role_id WHERE (roles_users.user_id = 1 )
ORDER
BY name ASC[0m
[4;36;1mJoin Table Columns (0.000308)[0m [0;1mSHOW FIELDS FROM `rights_roles`[0m
[4;35;1mRight Load (0.000282)[0m [0mSELECT * FROM `rights` INNER JOIN
rights_roles ON rights.id = rights_roles.right_id WHERE (rights_roles.role_id =
1 )
ORDER BY name ASC[0m
[AUTH] content_nodes - *
[AUTH] files - *
[AUTH] orders - *
[AUTH] preferences - *
[AUTH] products - *
[4;36;1mCACHE (0.000000)[0m [0;1mSELECT * FROM `tags` WHERE (parent_id IS NULL
OR parent_id = 0) ORDER BY -rank DESC[0m
[4;35;1mProduct Load (0.000197)[0m [0mSELECT * FROM `items` WHERE
(`items`.`id` = 3) AND ( (`items`.`type` = 'Product' ) ) [0m
[4;36;1mJoin Table Columns (0.000365)[0m [0;1mSHOW FIELDS FROM `products_tags`[0m
[4;35;1mTag Load (0.000184)[0m [0mSELECT * FROM `tags` INNER JOIN
products_tags ON tags.id = products_tags.tag_id WHERE (products_tags.product_id
= 3
) [0m
[4;36;1mJoin Table Columns (0.000315)[0m [0;1mSHOW FIELDS FROM
`related_products`[0m
[4;35;1mProduct Load (0.000191)[0m [0mSELECT * FROM `items` INNER JOIN
related_products ON items.id = related_products.related_id WHERE
(related_products.product_id = 3 ) AND ( (`items`.`type` = 'Product' ) ) [0m
[4;36;1mProduct Load (0.000104)[0m [0;1mSELECT * FROM `items` WHERE
(`items`.`code` IS NULL) AND ( (`items`.`type` = 'Product' ) ) LIMIT 1[0m
[4;35;1mCACHE (0.000000)[0m [0mSELECT * FROM `items` WHERE (`items`.`code` IS
NULL) AND ( (`items`.`type` = 'Product' ) ) LIMIT 1[0m
[4;36;1mCACHE (0.000000)[0m [0;1mSELECT * FROM `items` WHERE (`items`.`code`
IS NULL) AND ( (`items`.`type` = 'Product' ) ) LIMIT 1[0m
[4;35;1mCACHE (0.000000)[0m [0mSELECT * FROM `items` WHERE (`items`.`code` IS
NULL) AND ( (`items`.`type` = 'Product' ) ) LIMIT 1[0m
[4;36;1mCACHE (0.000000)[0m [0;1mSELECT * FROM `items` WHERE (`items`.`code`
IS NULL) AND ( (`items`.`type` = 'Product' ) ) LIMIT 1[0m
[4;35;1mSQL (0.000045)[0m [0mBEGIN[0m
[4;36;1mItem Load (0.000247)[0m [0;1mSELECT * FROM `items` WHERE (items.code =
'88889' AND items.id <> 3) LIMIT 1[0m
[4;35;1mProduct Update (0.000170)[0m [0mUPDATE `items` SET `code` = '88889',
`variation_quantity` = 0, `quantity` = 88, `product_id` = 0, `size_depth` = 0.0,
`price` = 88.0, `type` = 'Product', `size_width` = 0.0, `description` = '',
`weight`
= 0.0, `date_available` = '2008-03-14 00:00:00', `size_height` = 0.0,
`is_discontinued` = 0, `name` = 'some other product' WHERE `id` = 3[0m
[4;36;1mSQL (0.000043)[0m [0;1mCOMMIT[0m
[4;35;1mImage Columns (0.000632)[0m [0mSHOW FIELDS FROM `user_uploads`[0m
#<ActionController::UploadedStringIO:0x2b405908cae0>
[4;36;1mSQL (0.000059)[0m [0;1mBEGIN[0m
[4;35;1mImage Create (0.000385)[0m [0mINSERT INTO `user_uploads`
(`content_type`, `created_on`, `size`, `thumbnail`, `type`, `filename`,
`height`,
`parent_id`, `width`) VALUES('image/jpeg', '2008-03-14 06:58:41', 3886, NULL,
'Image', 'jesus.jpeg', 108, NULL, 124)[0m
[4;36;1mImage Load (0.000280)[0m [0;1mSELECT * FROM `user_uploads` WHERE
(`user_uploads`.`thumbnail` = 'small' AND `user_uploads`.`parent_id` = 49) AND (
(`user_uploads`.`type` = 'Image' ) ) LIMIT 1[0m
[4;35;1mImage Create (0.000236)[0m [0mINSERT INTO `user_uploads`
(`content_type`, `created_on`, `size`, `thumbnail`, `type`, `filename`,
`height`,
`parent_id`, `width`) VALUES('image/jpeg', '2008-03-14 06:58:41', 3886, 'small',
'Image', 'jesus_small.jpeg', 174, 49, 200)[0m
[4;36;1mImage Load (0.000301)[0m [0;1mSELECT * FROM `user_uploads` WHERE
(`user_uploads`.`thumbnail` = 'thumb' AND `user_uploads`.`parent_id` = 49) AND (
(`user_uploads`.`type` = 'Image' ) ) LIMIT 1[0m
[4;35;1mImage Create (0.000257)[0m [0mINSERT INTO `user_uploads`
(`content_type`, `created_on`, `size`, `thumbnail`, `type`, `filename`,
`height`,
`parent_id`, `width`) VALUES('image/jpeg', '2008-03-14 06:58:41', 3886, 'thumb',
'Image', 'jesus_thumb.jpeg', 44, 49, 50)[0m
[4;36;1mSQL (0.094241)[0m [0;1mCOMMIT[0m
[4;35;1mSQL (0.000058)[0m [0mBEGIN[0m
[4;36;1mSQL (0.000040)[0m [0;1mROLLBACK[0m
ActiveRecord::AssociationTypeMismatch (Image expected, got Image):
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:1
50:in
`raise_on_type_mismatch'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:57:in
`<<'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:56:in
`each'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:56:in
`<<'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/databa
se_statements.rb:66:in
`transaction'
/vendor/rails/activerecord/lib/active_record/transactions.rb:80:in `transaction'
/vendor/rails/activerecord/lib/active_record/associations/has_many_through_assoc
iation.rb:55:in
`<<'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:100:in `save'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:94:in `each'
/vendor/plugins/substruct/app/controllers/admin/products_controller.rb:94:in `save'
/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib64/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
/vendor/rails/actionpack/lib/action_controller/caching.rb:678:in `perform_action'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_
cache.rb:33:in
`cache'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching.rb:677:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:76:in
`process'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in
`synchronize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in
`process'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load'
/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
/vendor/rails/railties/lib/commands/server.rb:39
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
./script/server:3
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in
`debug_load'
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/lib/ruby-debug.rb:90:in `main'
/usr/lib64/ruby/gems/1.8/gems/ruby-debug-ide-0.1.10/bin/rdebug-ide:74
/usr/bin/rdebug-ide:16:in `load'
/usr/bin/rdebug-ide:16
Rendering
/home/alosix/projects/ruby/substruct/vendor/rails/actionpack/lib/action_controll
er/templates/rescues/layout.erb
(internal_server_error)
Just ran into this myself after copying the image.rb file down and changing the
default image path.
It worked with the copy, but started dying after playing with the path. Still
alittle
new to this and need to hack on it a little further.
Jason
Original comment by jpow...@gmail.com
on 14 Mar 2008 at 10:57
This looks like it was mostly related to me overiding the Image files. I
removed a
lot of the duplicate stuff in my copy and it seemed to go away.
Still working getting them to successfully save in a different location, but at
least
now its not exploding.
Original comment by jpow...@gmail.com
on 14 Mar 2008 at 2:16
Marking this as an invalid issue since you mentioned it was related to
overriding image class...
Original comment by subim...@gmail.com
on 9 Apr 2008 at 1:34
Looks like it's a rails problem if you 'reinstantiate' classes.
see
http://www.ruby-forum.com/topic/101817 [link at the bottom]
Original comment by rogerpack2005
on 26 Apr 2008 at 3:44
If you get this, this patch fixes rails' bug
[add this code in]
module ActiveRecord
module Associations
class AssociationProxy #:nodoc:
private
def raise_on_type_mismatch(record)
unless record.class == @reflection.klass
raise ActiveRecord::AssociationTypeMismatch, "#{@reflection.class_name} ID #{@reflection.id} expected,
got #{record.class} ID #{record.id}"
end
end
end
end
end
Original comment by rogerpack2005
on 1 May 2008 at 5:52
Original issue reported on code.google.com by
rogerpack2005
on 29 Feb 2008 at 11:46