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

active_record.belongs_to_required_by_default functionality is disabled/overridden #297

Open
mattscilipoti opened this issue Mar 23, 2017 · 4 comments

Comments

@mattscilipoti
Copy link

The Problem

After installing 'simple_token_authentication', tests, that ensure belongs_to associations are required, now fail (presence is required by default in Rails 5). I tried removing each change and it occurs once the gem is required in the Gemfile.

The Cause

I haven't nailed down the cause, but I have found a workaround...

A Workaround

  • In your Gemfile, use require :false for simple_token_authentication.
  • require 'simple_token_authentication before its first use. For me, that is in config/initializers/simple_token_authentication.rb

The Nitty Gritty

  • rails (5.0.1)
  • activerecord (5.0.1)
  • simple_token_authentication (1.15.1)

Anyone have any ideas?

@gonzalo-bulnes
Copy link
Owner

Hi @mattscilipoti,

Thanks for the report, I see no obvious reason of why this would occur but I'll think about it and let you know if I think of something. Anyone else, please comment here, ideas are welcome! Hopefully it's something we can get to understand properly : )

@mattscilipoti
Copy link
Author

I tried tracing this back. The issue existed when Rails 5 support was added in SHA: 3834199.

@mattscilipoti
Copy link
Author

I found a similar issue in acts_as_list (brendon/acts_as_list#268). The workaround I used here didn't work. I was able to trace it to a specific commit in that project, but I haven't identified the cause.

@gonzalo-bulnes
Copy link
Owner

Mmm, I'm sorry I missed your update @mattscilipoti. It sounds like something in the Simple Token Authentication dependencies changed that the acts as pattern depends on, I've no idea at this point what it could be. Did you find out more eventually?

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