public
Description: Rails SQL Views project extracted from ActiveWarehouse
Homepage: http://activewarehouse.rubyforge.org/rails_sql_views
Clone URL: git://github.com/aeden/rails_sql_views.git
name age message
file .gitignore Mon Apr 06 18:44:06 -0700 2009 Made it work with Rails 2.3.2, at least for MyS... [mschuerig]
file CHANGELOG Tue Nov 04 12:28:57 -0800 2008 added nonview_tables where missing. need to get... [aeden]
file CONTRIB Fri May 16 10:57:41 -0700 2008 initial checkin to git [aeden]
file LICENSE Tue Aug 19 04:30:09 -0700 2008 added license [aeden]
file README Fri May 16 10:57:41 -0700 2008 initial checkin to git [aeden]
file Rakefile Tue Nov 04 11:23:20 -0800 2008 updated to current gem require style [aeden]
file TODO Tue Apr 07 02:24:42 -0700 2009 Renamed Adapter#nonview_tables to #base_tables ... [mschuerig]
file init.rb Wed Jun 24 13:05:03 -0700 2009 Adding init.rb. This file tied the plugin into... [Roberto Aguilar]
directory lib/ Thu Aug 13 11:36:46 -0700 2009 Don't require rubygems [smtlaissezfaire]
directory rails/ Mon Apr 06 18:44:06 -0700 2009 Made it work with Rails 2.3.2, at least for MyS... [mschuerig]
directory test/ Thu Aug 13 11:31:43 -0700 2009 Turn off migration output so that tests run cle... [smtlaissezfaire]
README
== Rails SQL Views

Library which adds SQL Views to Rails. Adds create_view and drop_view to the 
ActiveRecord::ConnectionAdapters::AbstractAdapter (which makes them available to migrations) and adds support for 
dumping views in the ActiveRecord::SchemaDumper.

== Installation

To install:

  gem install rails_sql_views
 
Then add the following to your Rails config/environment.rb:

  require_gem 'rails_sql_views'
  require 'rails_sql_views'

== Usage

You can then use create_view and drop_view in your migrations. For example:

  class CreatePersonView < ActiveRecord::Migration
    def self.up
      create_view :v_people, "select * from people" do |t|
        t.column :id
        t.column :name
        t.column :social_security
      end
    end

    def self.down
      drop_view :v_people
    end
  end
  
This extension also adds support for views in the ActiveRecord::SchemaDumper class.

The following drivers are supported:

 MySQL
 PostgreSQL (Native and Pure Ruby)
 Oracle
 SQL Server

== Known Issues

* Drivers not mentioned above are not supported.

If you find any issues please send an email to anthonyeden@gmail.com .

== Contributing

If you would like to implement view support for other adapters then please drop me an email. Better yet, write up the 
adapter modifications and send them to me. :-)