Giter Site home page Giter Site logo

Comments (8)

metaskills avatar metaskills commented on May 16, 2024

Totally understood. The hacks we have had to do in the 2.x version of the adapter are not the best and the work in the 3.x version avoids all this. So this will be a 2.x patch.

Our options are limited to raw string scanning to find a table name and then reflect on the primary key of that table, again assuming we find a properly named AR class based on the singular table name. Or trusting the SQL format enough to find an ID in it. Or ultimately falling back to just id as coded now. There are helpers in the adapter for doing this.

Would you care to take a stab at it, write a regression tests and submit a patch? If so, this work should be done in the 2-3-stable remote tracking branch.

from activerecord-sqlserver-adapter.

Excelan avatar Excelan commented on May 16, 2024

I'm really sorry Ken, for now I'm just a blind kitten in ruby and rails. :(
I'd love to, but googling tutorails isn't a quick way to mastering ruby :)
Probably I'll try.

from activerecord-sqlserver-adapter.

metaskills avatar metaskills commented on May 16, 2024

That's OK, I can do this, it will just take me awhile, but I will get back to this after the rails3 work.

from activerecord-sqlserver-adapter.

Excelan avatar Excelan commented on May 16, 2024

I was excited rail couple months ago, and then again after the railsconf and forthcoming rails 3 anouncement. So I was keen to apply rails3 power to my legacy database. Soon i found out that there is no sqlserver-adapter for rails3 yet and started with rails 2.3
So rails 3 adapter is definitely preferable :) Thank you, for all your work.

There are some other hardcoded restrictions. For example it is also imposible to organize abstract connection (:abstract=>true) with legacy column names. So I create views with proper names as a workaround.

from activerecord-sqlserver-adapter.

metaskills avatar metaskills commented on May 16, 2024

Interesting, I've used abstract classes in 2.3 w/adapter for some time. Can you be specific? FYI, the adapter has great support for views too.

from activerecord-sqlserver-adapter.

Excelan avatar Excelan commented on May 16, 2024

Shot me. :)

I meant :polymorphic

belongs_to :Owner, :polymorphic => true, :primary_key => :Id, :foreign_key => :OwnerId

won't work, because of hardcoded "_id" and "_type" everywhere

from activerecord-sqlserver-adapter.

metaskills avatar metaskills commented on May 16, 2024

Tell you what, I'm gonna close this ticket because I doubt that I'll be doing anything related to limit/offset or eager loading in the 2.3 branch. It's just too hard and after so much time put to the 3 version, I'm just not able to help.

Here is what I suggest. The rails 3 version is passing all tests in ActiveRecord for rails 3, tracking the 3-0-stable branch of rails, currently unreleased. So if you freeze to edge 3-0-stable rails then use the current master branch of the adapter, you should be OK.

from activerecord-sqlserver-adapter.

Excelan avatar Excelan commented on May 16, 2024

That's ok. Since there is a workaround - one can use views with required names, and this branch become obsolete, it is a clever decission to concentrate efforts on version 3 branch.

Please close the ticket.

from activerecord-sqlserver-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.