ranked-model icon indicating copy to clipboard operation
ranked-model copied to clipboard

Updating the readme for beginners like myself

Open ghost opened this issue 12 years ago • 2 comments

Not really an issue, but I believe, for certain people, a slightly more detailed readme could be of use in diagnosing some of the issues I had when setting this (otherwise very easy to use) plugin up.

For instance, you include having to set up the row_order column as an integer, but don't mention having to also set up a row_order_position column as an integer.

Also, setting those both to default to 0 instead of nil tripped me up for a short while.

Obviously not huge issues, but it might help adoption by those of us who might have otherwise given up on a great plugin because they weren't sure where to look for the solution (the answer being in the console and logs to see where the problem was for me, and then look at the source code to see what was expected- but again, this is merely to help out beginners.

Let me know what you think - if you're busy, I'd be happy to write a slightly modified readme and submit it to you.

Regardless, thanks for the great plugin.

Steve

ghost avatar Dec 05 '12 00:12 ghost

Hey @stayfq - you should not need a row_order_position column. RankedModel fakes a position column, while storing the order information in your integer column. A default value shouldn't be required either- but let me know if you are/were seeing an error and what it might be. Items with NULL values will definitely mess up your orders, but that only makes sense.

I'm always open to pull requests! The STI behavior is probably the next feature item that needs documentation. It's speced out well in the tests, but not really mentioned in the readme.

mixonic avatar Dec 05 '12 01:12 mixonic

Thanks for the quick reply.

It's quite likely I don't know what's happening, or how I really solved things. Here's the way I got this working for me:

Followed readme example, after bundle install and including RankedModel, created the row_order column in my tasks table as an integer. This values all started off initially as nil.

It probably makes sense to more seasoned developers, but it took me a minute ( read: hour+ ) to figure out why things weren't working for me.

Once I set the default for my row_order column to be 0 and updated the values, I was able to sort and see the correct values. Is this the correct behavior (default being 0 or not needing to be set) or did I screw something up/misunderstand something along the way?

Like I said, relatively newbish, so it's doubtful this would be a problem for many others, but it never hurts to have too much documentation or a link to a tutorial where someone set up and used your plugin for people like myself who might otherwise struggle without a roadmap.

Again, thanks for both the plugin and your quick response.

Steve

ghost avatar Dec 05 '12 01:12 ghost

Closing this. I assume everyone has moved on. If you want to improve the documentation I'll always happily accept PRs for that :D

brendon avatar Jun 04 '24 04:06 brendon