Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6860705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:26:32+00:00 2026-05-27T02:26:32+00:00

I am trying to use migrations to manage my SQL Server views. I found

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:26:32+00:00Added an answer on May 27, 2026 at 2:26 am

    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:

    class CreateFundView < ActiveRecord::Migration
      def up
    create_view :funds,
                "SELECT     TOP (100) PERCENT
                  FUND.FUND_ID AS [fund_id],
                  FUND.DESCRIPTION AS [fund_description],
                  FUND_FUND_CATEGORY.LONGDESCRIPTION AS [fund_category],
                  FUND.NOTES AS [fund_notes]
                  FROM
                    RE7.dbo.FUND AS FUND LEFT OUTER JOIN
                    RE7.dbo.TABLEENTRIES AS FUND_FUND_CATEGORY ON FUND.FUND_CATEGORY = FUND_FUND_CATEGORY.TABLEENTRIESID
                  WHERE     (FUND.FUNDTYPE = 23702)
                  ORDER BY [fund_description]"
      end
    
      def down
        drop_view :funds
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
Trying to use a guid as a resource id in a rest url but
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
I'm trying to use EF 4.3 migrations with multiple code-first DbContexts. My application is
I'm trying to use Phing to automate : running tests running DB migrations on
I'm trying to use EF 4.3 migrations feature. My ASP.NET MVC project stores connection
I'm trying to use T4 templates to make generating migrations for our system slightly
I am currently trying to use the activerecord gem in Ruby but I'm quite
I'm trying to use the suffix column of my class but I keep getting
I'm trying to use ActiveRecord's find_or_create_by_*column* , but I'm getting errors from Postgres letting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.