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

Rails 4.2, Arel 6.0.0 support #3

Open
glennfu opened this issue Jun 15, 2016 · 1 comment
Open

Rails 4.2, Arel 6.0.0 support #3

glennfu opened this issue Jun 15, 2016 · 1 comment

Comments

@glennfu
Copy link

glennfu commented Jun 15, 2016

This fork here works great right now for Rails 4.1: https://github.com/jgrevzie/activerecord-sqlanywhere-adapter/tree/rails40

However in Rails 4.2, Arel 6.0.0 was introduced. With that came a whole lot of structural changes. The activerecord-fb-adapter implemented these changes by switching the Adapter based on the Arel version like so:

From: https://github.com/rowland/activerecord-fb-adapter/blob/4dd8f7c04e49ab39d0d80b5cad0a842bac0fa090/lib/active_record/connection_adapters/fb_adapter.rb

if Arel::VERSION < "6.0.0"
  require 'arel/visitors/fb'
else
  require 'arel/visitors/fb_collector'
end

The original 'arel/visitors/fb' lives here: https://github.com/rowland/activerecord-fb-adapter/blob/master/lib/arel/visitors/fb.rb
The new 'arel/visitors/fb_collector' lives here: https://github.com/rowland/activerecord-fb-adapter/blob/master/lib/arel/visitors/fb_collector.rb

Tagging @jgrevzie in hopes he sees this since he did such a great job with the other updates.

Unfortunately I'm brand new to the project that uses this gem so I don't have a test suite built up to ensure I wouldn't be breaking anything if I tried the implementation myself. I'm posting this in case it inspires someone else to take a stab at it. Maybe I'll come back to this in the future once I've gotten a bit more into it!

@jgrevzie
Copy link

I used the test suite that comes with ActiveRecord itself. I managed to get about 95% of the tests to pass. There were some issues with timestamps, and a few remaining cases where SQL Anywhere's 'special' version of SQL caused issues. Happy to continue to help.

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