I am trying to use migrations to manage my SQL Server views. I found the rails_sql_views extension and it looks like exactly what I need, but I’m getting an error when running the migration that I cant figure out. Here is the error:
rake aborted!
An error has occurred, this and all later migrations canceled:
uninitialized constant CreateFunds
Here is my migration:
class CreateFundView < ActiveRecord::Migration
def up
create_view :v_funds, "SELECT * from funds"
end
def down
drop_view :v_funds
end
end
I’m using Rails 3.1.1.
Can anyone help me out?
I got it working, I upgraded the rails_sql_views gem to one that was Rails 3.1.1 compatible.
(at least I think that’s what fixed it!). Here is a link to the gem that is working:
https://github.com/mremolt/rails_sql_views.git
Here is a working migration: