On Sunday, January 5, 2014 10:52:19 PM UTC-8, Andrew Hacking wrote:
>
>
> I am encountering an issue when using the auto_validations and
> single_table_inheritance plugins together on the same model.
>
> Every instantiation of a model seems to be triggering a schema query of
> the form:
>
> SELECT "indc"."relname" AS "name", "ind"."indisunique" AS "unique",
>> "att"."attname" AS "column", "con"."condeferrable" AS "deferrable" FROM
>> "pg_class" AS "tab" INNER JOIN "pg_index" AS "ind" ON ("ind"."indrelid" =
>> "tab"."oid") INNER JOIN "pg_class" AS "indc" ON ("indc"."oid" =
>> "ind"."indexrelid") INNER JOIN "pg_attribute" AS "att" ON
>> (("att"."attrelid" = "tab"."oid") AND ("att"."attnum" =
>> ANY("ind"."indkey"))) LEFT JOIN "pg_constraint" AS "con" ON
>> ("con"."conname" = "indc"."relname") WHERE (("indc"."relkind" = 'i') AND
>> ("ind"."indisprimary" IS FALSE) AND ("indexprs" IS NULL) AND ("indpred" IS
>> NULL) AND ("indisvalid" IS TRUE) AND ("tab"."oid" =
>> CAST(CAST('"XXX_TABLE_NAME_XXX"' AS regclass) AS oid)) AND ("indisready" IS
>> TRUE) AND ("indcheckxmin" IS FALSE)) ORDER BY "indc"."relname", (CASE
>> "att"."attnum" WHEN "ind"."indkey"[0] THEN 0 WHEN "ind"."indkey"[1] THEN 1
>> WHEN "ind"."indkey"[2] THEN 2 WHEN "ind"."indkey"[3] THEN 3 WHEN
>> "ind"."indkey"[4] THEN 4 WHEN "ind"."indkey"[5] THEN 5 WHEN
>> "ind"."indkey"[6] THEN 6 WHEN "ind"."indkey"[7] THEN 7 WHEN
>> "ind"."indkey"[8] THEN 8 WHEN "ind"."indkey"[9] THEN 9 WHEN
>> "ind"."indkey"[10] THEN 10 WHEN "ind"."indkey"[11] THEN 11 WHEN
>> "ind"."indkey"[12] THEN 12 WHEN "ind"."indkey"[13] THEN 13 WHEN
>> "ind"."indkey"[14] THEN 14 WHEN "ind"."indkey"[15] THEN 15 WHEN
>> "ind"."indkey"[16] THEN 16 WHEN "ind"."indkey"[17] THEN 17 WHEN
>> "ind"."indkey"[18] THEN 18 WHEN "ind"."indkey"[19] THEN 19 WHEN
>> "ind"."indkey"[20] THEN 20 WHEN "ind"."indkey"[21] THEN 21 WHEN
>> "ind"."indkey"[22] THEN 22 WHEN "ind"."indkey"[23] THEN 23 WHEN
>> "ind"."indkey"[24] THEN 24 WHEN "ind"."indkey"[25] THEN 25 WHEN
>> "ind"."indkey"[26] THEN 26 WHEN "ind"."indkey"[27] THEN 27 WHEN
>> "ind"."indkey"[28] THEN 28 WHEN "ind"."indkey"[29] THEN 29 WHEN
>> "ind"."indkey"[30] THEN 30 WHEN "ind"."indkey"[31] THEN 31 ELSE 32 END)
>>
>
> I traced the problem in the debugger and setup_auto_validations() is being
> called due to dataset change:
>
> Plugins.after_set_dataset(self, :setup_auto_validations)
>
>
This isn't a general problem, as I showed in my response to your GitHub
issue.
If you look at the backtrace for this line, you should be able to see what
is calling set_dataset on the model at runtime. If you can't determine
that yourself, please post the backtrace here and I'll take a look at it.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.