why Marshal.dump a relation obejct would faile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

why Marshal.dump a relation obejct would faile

李永博
with a special scope Marhal.dump(result) wolud cause a faile


*** 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/af10d774-1ee9-4213-91f2-f8d912f63607%40googlegroups.com.