On Thursday, September 5, 2019 at 6:57:15 AM UTC+1, 李永博 wrote:
> with a special scope Marhal.dump(result) wolud cause a faile
>
>
Proc objects just can't be dumped - this is a limitation of ruby.
Fred
>
>
> *** TypeError Exception: no _dump_data is defined for class Proc
>
>
> ```
> (byebug) result.class
> BatchCloth::ActiveRecord_Relation
> (byebug) Marshal.dump(result)
> *** TypeError Exception: no _dump_data is defined for class Proc
>
>
> (byebug) puts result.to_sql
> SELECT DISTINCT batch_cloths.*, batch_cloths.created_at FROM "batch_cloths" INNER JOIN "product_variants" ON "product_variants"."id" = "batch_cloths"."product_variant_id" LEFT OUTER JOIN "quality_control_tasks" ON "quality_control_tasks"."id" = "batch_cloths"."quality_control_task_id" AND "quality_control_tasks"."deleted_at" IS NULL INNER JOIN "reception_items" ON "reception_items"."id" = "quality_control_tasks"."qcable_id" AND "reception_items"."deleted_at" IS NULL AND "quality_control_tasks"."qcable_type" = 'ReceptionItem' INNER JOIN "receptions" ON "receptions"."id" = "reception_items"."reception_id" AND "receptions"."deleted_at" IS NULL INNER JOIN "factories" ON "factories"."id" = "receptions"."factory_id" AND "factories"."deleted_at" IS NULL WHERE "batch_cloths"."deleted_at" IS NULL AND "batch_cloths"."company_id" = 2 AND "factories"."uuid" = 'df9dbf09-fd10-4546-a511-e103bed8a6e4' AND "batch_cloths"."sample" = FALSE AND "product_variants"."variant_category" = 0 AND "batch_cloths"."stock_status" IN (0, 5, 6, 1) ORDER BY batch_cloths.created_at DESC
>
>
> ```
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/477754bf-6b73-48b7-8b29-38d306cf3c26%40googlegroups.com.
No comments:
Post a Comment