Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually init classes list #692

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RossinesP
Copy link
Contributor

During initialization, SugarOrm parses all the classes in a specified package and finds all SugarRecord classes. This has been problematic in the past because of InstantRun and newest Gradle build tools.

This commit adds a way to manually declare the list of classes we want to convert to tables.
Simply provide a list of Class objects when calling SugarContext.init() or extend SugarApp and its getModelsClassesList() method.
All of this is obviously optional.

Note that no test and no example app has been written for this modification.

@mention-bot
Copy link

@RossinesP, thanks for your PR! By analyzing the history of the files in this pull request, we identified @JonatanSalas, @sibelius and @whoshuu to be potential reviewers.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 74.536% when pulling d55f915 on RossinesP:manual_init into cb45742 on satyan:master.

@gstorer
Copy link

gstorer commented Apr 6, 2017

Just a heads up. getModelsClassesList() isn't called anywhere. I had to modify SugarApp.onCreate() to use the list accepting version of SugarContext.init() to get this to work with the method over ride. It works fine manually calling the init method though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants