Skip to content

Works under Rails v4.0.0 #278

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

Merged
merged 2 commits into from
Jan 17, 2014
Merged

Conversation

rapofran
Copy link
Contributor

@rapofran rapofran commented Aug 5, 2013

No description provided.

@rapofran
Copy link
Contributor Author

rapofran commented Aug 5, 2013

I couldn't run the test yet. But it's working fine in our testing servers.

@scaryguy
Copy link

@metaskills I consider to use this fork, why do you think we should be warned? Don't you think is that safe? We're just going to use it for database migration.

@rapofran
Copy link
Contributor Author

I commented some lines, they were giving me errors.

@yertle
Copy link

yertle commented Aug 27, 2013

How do I install this for use with rails 4.0.0? I tried to put git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git in my Gemfile, but I get an error that activerecord-sqlserver-adapters depends on activerecords 3.2.0. Is the master not compatible with 4.0.0? Sorry for my ignorance, I don't know a lot about Git and I'm just trying to get rails 4.0.0 working with an MS Sql Server...

@rapofran
Copy link
Contributor Author

Yertle you can use my fork, just put in your Gemfile:

gem 'activerecord-sqlserver-adapter', github: 'Desarrollo-CeSPI/activerecord-sqlserver-adapter'

@yertle
Copy link

yertle commented Aug 28, 2013

Thanks for that - I got it working. However, just found out my MSSQL server is 2000, and tiny_tds only goes back to 2005. So I'll go try to find another solution. Thanks again though.

@rapofran
Copy link
Contributor Author

Are you sure ? I think it has compatibility with MSSQL 2000. From https://github.com/rails-sqlserver/tiny_tds#freetds-compatibility--configuration

[...] It is tested with SQL Server 2000, 2005, 2008 and Azure. [...]

@yertle
Copy link

yertle commented Aug 28, 2013

Sorry, it is activerecord-sqlserver-adapter that only goes back to 2005. v2.3 of activerecord-sqlserver-adapter will support SQL server 2000, but that is only compatible with Rails 2.3. I may have to start over with that. I'm trying to migrate some old ruby (1.2.2) code to a new Ubuntu box, and it has been a headache for a number of reasons. I think my best bet may be to try installing Rails 2 and getting everything on that, instead of 4.0.0.

Unless I can find an alternative to activerecord-sqlserver-adapter - the codebase used odbc with freetds before...

@lightswitch05
Copy link

What are the plans on merging this into a new version 4.0 branch?

@metaskills
Copy link
Member

Very little until these solutions are vetted properly with some test statistics before and after.

@friedheim
Copy link

I tried to update to rails 4.0.1 that was released some days ago and got this error:
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
activerecord-sqlserver-adapter (>= 0) x86-mingw32 depends on
activerecord (= 4) x86-mingw32

rails (~> 4.0.1) x86-mingw32 depends on
  activerecord (4.0.1)

I don't know if this is the right place to write this, but I didn't find other place in your repository.

Thanks

@thaddeus-git
Copy link

this requires arel 4.0.0 and incompatible with arel 4.0.1
maybe it is not the cause of your problem, but needs to be noticed

@friedheim
Copy link

and activerecord 4.0.1 depends on arel 4.0.1, so I can't use rails 4.0.1 that requires activerecord 4.0.1 with activerecord-sqlserver-adapter which requires activerecord 4.0.0, is there a way to change to arel 4.0.0 with using rails 4.0.1? Or will it be possible in the future?

@thaddeus-git
Copy link

gem 'arel','=4.0.0'

@friedheim
Copy link

thanks, but it doesn't work, if I add this in my gemfile, because of dependency to activerecord 4.0.0. Bundle install gives me the following error:
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
activerecord-sqlserver-adapter (>= 0) x86-mingw32 depends on
activerecord (= 4) x86-mingw32

rails (~> 4.0.1) ruby depends on
  activerecord (4.0.1)

I suppose it's the line

in the activerecord-sqlserver-adapter.gemspec file
s.add_dependency('activerecord', '4')
I'm using the repository in Desarrollo-CeSPI/activerecord-sqlserver-adapter, or what other repository works with rails 4?

@friedheim
Copy link

I found, that it works with the repository rapofran/activerecord-sqlserver-adapter
Thanks!

@annaswims
Copy link
Contributor

To elaborate on @metaskills "Be ⚠️'ed" - Not only do the tests not pass, they haven't been run on the Desarrollo-CeSPI:rails-4 branch. I'm working on getting the tests to run here after a bit of work, I'm down to 75 failures, 372 errors and 31 skips Gist of test output.

That being said, I've used the Desarrollo-CeSPI:rails-4 branch in a simple app and haven't run into any problems.

@dugsmith
Copy link

Does anyone have an update on the progress for Rails 4 support? I ran simple tests with the Desarrollo-CeSPI/activerecord-sqlserver-adapter branch and it seems to work against our SQL Server 2005 database, though it is pegged to Rails 4.0.0 (can't do 4.0.2).

Thank you for creating and supporting this gem!

@annaswims
Copy link
Contributor

I've been working on it part time. You can see my progress here https://github.com/annaswims/activerecord-sqlserver-adapter/tree/rails-4. There is a LOT of work left to make it fully rails 4 compatible. I think a lot of the simple stuff works now, but I certainly wouldn't advocate using it in production. I'd say the earliest I'd have it done is a month, though if you're willing to help it could go faster. As far as being pegged do rails 4.0.0, I think that it's mainly because Desarrollo-CeSPI:rails-4 only works with arel 4.0.0.

@metaskills
Copy link
Member

because Desarrollo-CeSPI:rails-4 only works with arel 4.0.0.

I am not sure that statement is true. I believe what @dugsmith is saying the same thing I was about the gem spec being too restrictive. It should be set to ~> 4.0.0 so any 4.0.x version can be used. Currently the latest is 4.0.2.

@dugsmith
Copy link

@annaswims thank you for working on this! I don't have time to help code it right now, but I can pull builds and test them in a pretty complex app as you hit milestones. @metaskills is right, I think the gemspec needs to accept any version of Rails 4.0.x for now (hopefully 4.1 soon after it is fully released).

@metaskills
Copy link
Member

can pull builds and test them in a pretty complex app

This is mostly moot. As the adapter changes for any major version, the real test is to see if the tests pass. The majority of the time should be spent here when making milestones. You can test release candidates on your app, but I wanted to point out that the test suite is the real test and that it is moot to test apps when the ActiveRecord suite is failing.

@metaskills
Copy link
Member

That said, I do appreciate your willingness to help @dugsmith - I just wanted to point out that testing apps is just enabling pain when the test suite does not pass.

@dugsmith
Copy link

the test suite is the real tests and that it is moot to test apps when the ActiveRecord suite is failing

Good point. I'll wait and watch how things go for now. I appreciate your investment into this project.

@slowjack2k
Copy link

Hi,

is there an official release which work's with rails 4.x?

Regards
Dieter

@igorescobar
Copy link

@rapofran does a more flexible gemspec sounds like an good update?

s.add_dependency('activerecord', '~> 4.0.0')

With your current gemspec I can't use it with Rails 4.0.2 was that on purpose?

@igorescobar
Copy link

@slowjack2k same question here.

@slowjack2k
Copy link

In this fork https://github.com/nextgearcapital/activerecord-sqlserver-adapter/tree/rails-4
@thirdshift is working to get the test pass. I hope he will finish it.

@annaswims
Copy link
Contributor

All but one test pass, so we're pretty close to having it ready. I'd like to do just a bit of cleanup before submiting a pull request but if you're impatient, have at it - https://github.com/nextgearcapital/activerecord-sqlserver-adapter/tree/rails-4 .

@dugsmith
Copy link

Great work, @annaswims! Thank you for moving this forward! Looking forward to it when it's ready.

@slowjack2k
Copy link

@annaswims Thank you. I tried your branch and got the following error:

> rails c 
activerecord-sqlserver-adapter-188f9bb20cc8/lib/arel/select_manager.rb:10:in `<class:SelectManager>': undefined method `order' for class `Arel::SelectManager' (NameError)
    from ruby-2.0.0-p353@rails_test/bundler/gems/activerecord-sqlserver-adapter-188f9bb20cc8/lib/arel/select_manager.rb:2:in `<module:Arel>'
    from ruby-2.0.0-p353@rails_test/bundler/gems/activerecord-sqlserver-adapter-188f9bb20cc8/lib/arel/select_manager.rb:1:in `<top (required)>'
    from ruby-2.0.0-p353@rails_test/gems/arel-4.0.1/lib/arel.rb:22:in `require'
    from ruby-2.0.0-p353@rails_test/gems/arel-4.0.1/lib/arel.rb:22:in `<top (required)>'
    from ruby-2.0.0-p353@rails_test/gems/activerecord-4.0.1/lib/active_record.rb:27:in `require'
    from ruby-2.0.0-p353@rails_test/gems/activerecord-4.0.1/lib/active_record.rb:27:in `<top (required)>'
    from ruby-2.0.0-p353@rails_test/gems/activerecord-4.0.1/lib/active_record/railtie.rb:1:in `require'
    from ruby-2.0.0-p353@rails_test/gems/activerecord-4.0.1/lib/active_record/railtie.rb:1:in `<top (required)>'
    from config/application.rb:4:in `require'
    from config/application.rb:4:in `<top (required)>'
    from ruby-2.0.0-p353@rails_test/gems/railties-4.0.1/lib/rails/commands.rb:60:in `require'
    from ruby-2.0.0-p353@rails_test/gems/railties-4.0.1/lib/rails/commands.rb:60:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

ruby-2.0.0
rails 4.0.1
adapter-commit: 188f9bb

I think the issue is with activerecord-sqlserver-adapter Arel::SelectManager. It inherits from rails Arel::TreeManager, but order is defined in
rails Arel::SelectManager.

@slowjack2k
Copy link

I did clone the repo and solved my previous Issue with

# in lib/arel/select_manager.rb

require 'arel/select_manger'

I didn't get it that the class was reopened at the first glance. Maybe a module which
extends the select manager would be more explicit.

But I got 35 failures, with (SQLSERVER 10.0.1600):

RAILS_VERSION=4.0.2 bundle
RAILS_VERSION=4.0.2 bundle exec rake test ACTIVERECORD_UNITTEST_HOST='XXX.XXX.XXX.XXX'
 4461 tests, 4415 passed, 11669 assertions, 35 failures, 11 errors, 30 skips

and with:

RAILS_VERSION=4.0.1 bundle
RAILS_VERSION=4.0.1 bundle exec rake test ACTIVERECORD_UNITTEST_HOST='XXX.XXX.XXX.XXX'
 4461 tests, 4414 passed, 11667 assertions, 35 failures, 12 errors, 30 skips

@igorescobar
Copy link

@slowjack2k same problem here.

@igorescobar
Copy link

The fact that arel is in v5.0.0 and we're using v4.0.1 isn't a problem right?

@annaswims
Copy link
Contributor

I pushed something before it was ready last night. My bad. I think I may have pushed the fix, but I won't have time to really look at it until this afternoon. @igorescobar I've been running the tests against the rails/4-0-stable and arel/4-0-stable branches in both ruby 1.9.3 and ruby 2.0.0. Eventually, I'd like to test against rails 4.1.0.beta and Arel 5, but I want to get it working in Rails 4.0 first.

@metaskills
Copy link
Member

want to get it working in Rails 4.0 first.

That is critical and complimentary to our versioning policy. No 4.0.x version of the adapter will support both 4.0 and 4.1. Given that the adapter is this far behind, bringing up 4.1 is pretty much moot.

@annaswims Please do not couple 4.0 and 4.1 development. Thanks and keep up the good work. I will find time to review, QA and do all my things when you are ready.

@sixfeetover
Copy link
Contributor

@annaswims Thanks so much for your work on this. I'm excited to give it a try!

@igorescobar
Copy link

That fork worked perfectly for my use case: https://github.com/arthrex/activerecord-sqlserver-adapter.git
Using Ruby 2, Rails 4.0.2. Tested all forks posted here with no success on my use case :(

@slowjack2k
Copy link

@annaswims Thank you! Good Job! Down to 1 error :)

@metaskills
Copy link
Member

To those following along, I made some [statements over here] in general to the future of the adapter.

TL;DR - I believe this is our home and I am looking forward (and advice) on how to take step back and transition. I may find some time soon to move things over to here and get @annaswims repo access once I do a quick code revue. Does that sound cool?

@metaskills
Copy link
Member

#279 (comment)

@dugsmith
Copy link

+1!

@igorescobar
Copy link

@metaskills cool as hell!

@scheerer
Copy link

👍 @metaskills for #279 (comment). I work with @annaswims and @thirdshift who have been spending a lot of time working to get the tests in good shape. They are very eager and proud of their work, but also very respectful of the many years and hard work you have put into the adapter as it stands today.

@metaskills metaskills merged commit b606c5c into rails-sqlserver:master Jan 17, 2014
@metaskills
Copy link
Member

Thanks!

@jmuheim
Copy link

jmuheim commented Feb 18, 2014

We need this as a runtime dependency in a gem, and sadly we can't specify a git repo there but only "real" released versions.

When will version 4.0 be released? Thanks for your hard work.

@annaswims
Copy link
Contributor

I've updated the 4.0 Milestone to include all of the things that I'd like to address before releasing a 4.0 version. Perhaps @metaskills has more to add to the list. Really, it mostly comes down to being a bit stumped on #306 . For a while, I was fortunate to be able to work on this during the work day, but I've moved on to other things and will only be working on it in my (limited) free time.

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.