Closed frederikspang closed 1 year ago
@frederikspang Would you be able to create a script that recreates the issue as I haven't been able to? See https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/How-to-report-a-bug
@aidanharan I'll give it a go as soon as possible.
@aidanharan My initial attempts to make a reproduction case, actually revealed the error. We run a multi-database setup, within same DBMS, meaning our view(and table_name) defined as MY_DB..v_my_view
. I have created a PR to accommodate for this.
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1029
This atleast solves this case. There may exist other cases for this same error, and you may have another ruby-preference than my solution. Please let me know, so I can adjust accordingly.
Issue
Exception is thrown when model is wrapping DB Views.
Expected behavior
It should run simple SELECT queries, like is the case with < v7. And which is the case for normal table selects
Actual behavior
raises
NoMethodError
in schema_statements.rb:600 inviews_real_column_name
How to reproduce
create view x as select a,b,c from TBL_Y
)Details
7.0.2.4
7.0.0
2.1.5
Full backtrace of error