#1068 ✓resolved
FreakGuard

STI bug (+options[:field]+ entry :pick_next does not map to a property in Game)

Reported by FreakGuard | October 1st, 2009 @ 08:06 AM | in 1.1

How to reproduce: http://pastie.org/638015

My thoughts: It's 'Game' not 'CaptainGame', so it seems to be a problem with STI and property :type

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) October 7th, 2009 @ 01:23 PM

    • Milestone set to 0.10.2
    • State changed from “new” to “accepted”
    • Assigned user set to “Dan Kubb (dkubb)”
  • Greg Campbell

    Greg Campbell October 30th, 2009 @ 07:03 PM

    Is there any workaround for this one?

  • FreakGuard

    FreakGuard November 1st, 2009 @ 10:51 AM

    I suppose you could define the properties in the ancestor model, but haven't tried it so far...

  • FreakGuard

    FreakGuard November 4th, 2009 @ 10:02 AM

    Ir works with edge dm-core! :-)

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 6th, 2009 @ 01:43 AM

    • State changed from “accepted” to “resolved”
  • Greg Campbell

    Greg Campbell December 16th, 2009 @ 06:52 PM

    • Tag set to regression, sti

    Dan, I can still reproduce this in 0.10.2. See http://gist.github.com/258387 - in my case, it appears to be triggered by enumerating a collection of multiple STI subclasses in such a way that a property that only exists for one of the subclasses is accessed. Note that this will succeed if you call to_a on the collection before enumerating it, so I believe it may have something to do with SEL.

    Marking this as a regression, as it worked in 9.x. It seems to work for more cases in 0.10.2 than it did for 0.10.1, though.

  • Greg Campbell

    Greg Campbell December 17th, 2009 @ 04:36 PM

    • State changed from “resolved” to “confirmed”
  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM

    • Milestone changed from 0.10.2 to 1.0.0
  • Dan Kubb (dkubb)
  • Dan Kubb (dkubb)
  • Martin Gamsjaeger (snusnu)

    Martin Gamsjaeger (snusnu) January 14th, 2011 @ 09:40 PM

    • State changed from “confirmed” to “resolved”
    • Milestone set to 1.1
    • Milestone order changed from “0” to “0”

    This seems to be resolved on master. Here's the output I get when running Greg's standalone snippet:

    ree-1.8.7-2010.02@datamapper mungo:dm-core snusnu$ ruby 1068.rb
     ~ (0.000141) SELECT sqlite_version(*)
     ~ (0.000172) DROP TABLE IF EXISTS "game_consoles"
     ~ (0.000018) PRAGMA table_info("game_consoles")
     ~ (0.000404) CREATE TABLE "game_consoles" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "type" VARCHAR NOT NULL, "xbox_live" BOOLEAN)
     ~ (0.000102) DROP TABLE IF EXISTS "game_consoles"
     ~ (0.000018) PRAGMA table_info("game_consoles")
     ~ (0.000140) CREATE TABLE "game_consoles" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "type" VARCHAR NOT NULL, "xbox_live" BOOLEAN)
     ~ (0.000077) DROP TABLE IF EXISTS "game_consoles"
     ~ (0.000008) PRAGMA table_info("game_consoles")
     ~ (0.000121) CREATE TABLE "game_consoles" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "type" VARCHAR NOT NULL, "xbox_live" BOOLEAN)
     ~ (0.000046) INSERT INTO "game_consoles" ("type", "xbox_live") VALUES ('XBox', 't')
     ~ (0.000036) INSERT INTO "game_consoles" ("type") VALUES ('Wii')
     ~ (0.000034) SELECT "id", "type" FROM "game_consoles" WHERE "type" IN ('GameConsole', 'Wii', 'XBox') ORDER BY "id"
     ~ (0.000037) SELECT "id", "type" FROM "game_consoles" WHERE "type" IN ('GameConsole', 'Wii', 'XBox') ORDER BY "id"
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Pages