0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem for finding out which objects have been orphaned on your iOS or Android App.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.2.0
 Project Readme

Ragamuffins

A simple gem for returning a list of Objects that might be orphaned on a corresponding iOS or Android app.

Ragamuffins takes an array of object ids, and returns a list of the ones that no longer exist in the database.

It was created after we made an iOS app that was having trouble with figuring out what existed on the backend and what no longer did. It sounds pretty simple, but when you add pagination to the mix things can get a little tricky. So this aims to solve that.

It has been tested with Ruby 2.0.0, 2.1.0 and 2.1.1. Has only made for Rails 4 and up.

Getting Started

Add to your gemfile

gem 'ragamuffins'

and then run the ol' bundle install

And that's it. That's all the setup you have to do!

Usage

The gem gives you a new class method called show_deleted_ids which takes an array of ids as an argument. It will do a quick scan of the model, and let you know what is know longer in the database.

For example:

visible_ids = ["1", "3", 5, 63]

YourModel.show_deleted_ids(visible_ids)

=> [1, 63]

This makes it easy for your iOS to go through and hide them so they don't give you grief.

Contributing

This is still a work in progress. So there is plenty left to do. If you want to contribute, open a pull request and make sure your code is tested.

To Do

  • Allow a visibility parameter for objects that might have a visibility boolean attribute.