Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- ActiveRecord::ConnectionAdapters::SQLServerAdapter does not support upsert HOT 2
- Warning: undefining the allocator of T_DATA class TinyTds::Result HOT 1
- TinyTds::Error: Server name not found in configuration files HOT 1
- 7.0.2.0 identity insert issue
- Tests failing following release of Rails v7.0.5
- Rails 7.1 HOT 1
- Copyright missing the Copyright owner
- [Rails 7.1] Upgrading the MSSQL adapter HOT 7
- Migration to Create Stored Procedure Incorrectly Treated as an Insert Statement HOT 1
- NotNullViolation in boolean field of view HOT 7
- TinyTds::Error: Error converting data type varchar to numeric. HOT 6
- String default value not retrieved when using views HOT 4
- Tracking rails/solid_cache compatibility
- Default value read from another field HOT 1
- Is add_check_constraint supported? HOT 3
- `raw_connection_do` method removed in 7.1.0 but still referenced in Readme HOT 2
- Composite Primary Keys not being recognised HOT 2
- limit() method with subqueries HOT 3
- Tables that are in schemas other than `dbo` are not properly reproduced in schema.rb HOT 1
- exclude_output_inserted_table_names does not support composite primary keys with different data types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activerecord-sqlserver-adapter.