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

DEPRECATION WARNING: #tables currently returns both tables and views. #933

Closed
BillyRuffian opened this issue Jun 12, 2016 · 12 comments
Closed
Milestone

Comments

@BillyRuffian
Copy link

With a spec

it { is_expected.to have_and_belong_to_many :teams }

The following deprecation warning is issued with Rails 5.0.0.RC1

DEPRECATION WARNING: #tables currently returns both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only return tables. Use #data_sources instead. (called from block (3 levels) in <top (required)> at /Users/nbt/Projects/DVLA/SkillsMatrix/spec/models/user_spec.rb:13)

@cesarjr
Copy link

cesarjr commented Jul 3, 2016

+1

@Preen
Copy link

Preen commented Jan 11, 2017

+1

2 similar comments
@ghost
Copy link

ghost commented Feb 17, 2017

+1

@brynmrk
Copy link

brynmrk commented Feb 20, 2017

+1

emrox pushed a commit to akra/shoulda-matchers that referenced this issue Apr 10, 2017
guialbuk pushed a commit that referenced this issue Apr 23, 2017
Fix #tables deprecation in Rails 5.0  - Fixes #933
@ehannes
Copy link

ehannes commented Apr 24, 2017

Was this fixed in 15fe030? Will this fix be released in a new version?

@guialbuk
Copy link
Collaborator

Yes. The original PR was merged yesterday.
We are developing the Rails 5.0 support in the rails-5 branch, so I recommend using this branch in your Gemfile.

gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'

@guialbuk
Copy link
Collaborator

Fixed by #943

@imogenkinsman
Copy link

@guialbuk is there anything we can do to contribute to the rails-5 branch? I'd love to see it merged into master, but not sure what still needs to be done to get it ready for that.

@guialbuk
Copy link
Collaborator

Hi, @jademcgough .
Sure! I'm adding the Rails 5 tag to some issues.
Another way to start contribution is taking a look at rails-5 branch failing tests.
Thanks!

tjgrathwell pushed a commit to railsbridge/bridge_troll that referenced this issue Jul 19, 2017
…ning

See issue here: thoughtbot/shoulda-matchers#933
See fix here: thoughtbot/shoulda-matchers#943
DEPRECATION WARNING: #tables currently returns both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only return tables. Use #data_sources instead.
@mcmire mcmire added this to the v4.0 milestone Sep 19, 2017
@jasonperrone
Copy link

Hi guys. Question about this. I was originally including just the shoulda gem:
gem 'shoulda', require: false

Then I upgraded to Rails 5.0 and I got the deprecation warning from shoulda-matchers. So, since shoulda says it doesn't have any code of its own, it's just shoulda-context + shoulda-matchers, I thought I could just replace that one gem statement with two:

gem 'shoulda-context'
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'

My tests fail when I do this because it seems there really is stuff in the shoulda gem. At least it seems my app does stuff that relies on the shoulda gem.

Including all three gems also causes problems. Maybe I am doing something wrong, but is there a preferred way for me to use the main shoulda, the main shoulda-context but the Rails 5 branch of shoulda-matchers?

@mcmire
Copy link
Collaborator

mcmire commented Feb 2, 2018

Hey @jasonperrone,

I'm assuming you're using Minitest, is that true? If that's true... shoulda-context is a little messed up right now. 😕 When I released shoulda-matchers 3.0, it broke support for shoulda-context. I documented the issue here: thoughtbot/shoulda-context#53. I meant to address that then, but I haven't been able to in the past due to other priorities. Now that we're trying to get 4.0 out the door, we have an opportunity to address this now, but I wanted to get 4.0 in a state to where all of the Rails 5 issues were taken care of and that way anyone trying to use shoulda-context wouldn't run into them and open any new issues that were actually old issues. So as it stands, there is not a way to use shoulda-matchers master along with shoulda-context, but rest assured I know about this already and I will address this soon.

@jasonperrone
Copy link

Understood. For now I am going to just include the master branch of the shoulda gem. The only negative effect I see thus far are deprecation warnings, so I'll just keep my eye out for updates to the main branch.

Thanks!

Hamled pushed a commit to AdaGold/rails-debugging that referenced this issue Apr 23, 2018
…ning

See issue here: thoughtbot/shoulda-matchers#933
See fix here: thoughtbot/shoulda-matchers#943
DEPRECATION WARNING: #tables currently returns both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only return tables. Use #data_sources instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants