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

Tenacity::ObjectDoesNotExistError thrown for mocks/stubs #44

Open
w1150n opened this issue Apr 11, 2013 · 1 comment
Open

Tenacity::ObjectDoesNotExistError thrown for mocks/stubs #44

w1150n opened this issue Apr 11, 2013 · 1 comment

Comments

@w1150n
Copy link

w1150n commented Apr 11, 2013

In my rspec tests I use stubbed foreign id's which causes Tenacity::ObjectDoesNotExistError errors to be thrown from t_belongs_to associations. Is there a way to make existence validation optional?

@jwood
Copy link
Owner

jwood commented Apr 11, 2013

There is currently no way to disable this check. The code that raises this exception is here:

https://github.com/jwood/tenacity/blob/master/lib/tenacity/instance_methods.rb#L24

The _t_verify_associates_exist method is invoked as a before_save callback on the model.

I'm not actively working on Tenacity at the moment, but I will accept pull requests if you feel like taking a crack at this.

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

No branches or pull requests

2 participants