rails-sqlserver/activerecord-sqlserver-adapter — Issue #131: Can I query to views?
Author: drobazko
Created: 2011-10-20 07:44:49+00:00
State: open

Hi! )

I'm under Windows XP.
MSSQL 2005
Ruby 1.9.2
RoR 3.0.9
activerecord-sqlserver-adapter 3.0.15
Tiny-TDS

I created a **view** named **Inv_first_materials** on my some table.
Also I created a model:

```ruby
class Inv_first_material < ActiveRecord::Base
end
```

I tried to execute a query:

```ruby
Inv_first_material.select("id").where(["code=1202"])
```
But I get error:

*ActiveRecord::StatementInvalid: TinyTds::Error: Invalid object name 'inv_first_materials'.: SELECT [inv_first_materials].id FROM [inv_first_materials] WHERE (code=1202)*

Can I query to views via activerecord-sqlserver-adapter and tiny-tds?

Thanks