#654 ✓resolved
andrew

[PATCH] New dm-adjust Method

Reported by andrew | November 15th, 2008 @ 01:51 AM

The dm-adjust plugin is a great idea, but it lacks the ability to operate on a single instance without doing something like Person.all(:id => 1).adjust(...). It isn't the most convenient way of incrementing/decrementing values. I've proposed a method called Resource#adjust() which acts upon a single object. My example works, but I'm not sure that I'm covering all the bases, so a critical walk-through would be helpful. I also know that the spec isn't entirely correct; it's missing the repository(:default) block.

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) December 2nd, 2008 @ 04:15 AM

    • Tag changed from dm-adjust, dm-more, plugins, suggestion to dm-adjust, dm-more, patch
    • State changed from “new” to “resolved”
    • Title changed from “New dm-adjust Method” to “[PATCH] New dm-adjust Method”
    • Assigned user changed from “Sam Smoot” to “Dan Kubb (dkubb)”

    Andrew, I have committed a Resource#adjust! method using your patch as a base:

    http://github.com/sam/dm-more/co...

    Some of the specs were actually broken, in that they depended on the state setup by earlier specs. I fixed that and added pending methods for Resource#adjust and Model#adjust, which will both be possible once dkubb/dm-core is merged into the mainline.

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 »

People watching this ticket

Attachments

Pages