jackdempsey / sequel_polymorphic

MIT License
37 stars 13 forks source link

`is` is not in Sequel anymore and should be removed from example in readme #5

Closed contentfree closed 10 years ago

contentfree commented 10 years ago

Pretty straightforward: The example in the readme uses is :polymorphic and that's no longer valid. Bit me (as a newb to Sequel).

jackdempsey commented 10 years ago

Thanks for the note. Is there an alternative way to get the same thing done? I haven't used Sequel for years but am happy to update this if so. If not, is this whole gem then deprecated from what you can tell?

contentfree commented 10 years ago

Far as I can tell you don't have to do anything besides include the gem, Sequel::Model.plugin :polymorphic and use :polymorphic or :as in the association. I'll try to confirm, but all I did is remove the is usage to get mine to run.

jackdempsey commented 10 years ago

Both is lines should go? What about the top one that doesn't say anything else about polymorphic? Intuitively it feels like something should be needed there, no?

contentfree commented 10 years ago

Not needed in either case. The to overrides from the plugin appear to do everything needed (after you've included the plugin in the model…)

jackdempsey commented 10 years ago

Removed. Thanks Dave!

contentfree commented 10 years ago

It looks like there's a syntax error in the many_to_one class_eval block. I think model = self.class.to_s.downcase should probably just be model = self.to_s.downcase ... trying that now.

(I know you're not maintaining this anymore... but I thought I'd document this here, at least)