Undefined Method 'views'

Hi,

I have installed rails_sql_views-0.1.0.gem in jruby\bin directory.

I referred this link
http://activewarehouse.rubyforge.org/rails_sql_views/
to create a database view

Code to create a view

class CreateViews < ActiveRecord::Migration
  def self.up
  create_view(:v_photo, "select description, content_type from photo")
do |t|
        t.column :description
        t.column :content_type
      end
  end

  def self.down
  drop_view(:v_photo)
  end
end

I got the view created successfully, and also got this error

E:\Work\JRuby\MyApp>jruby --command rake environment
RAILS_ENV=development_postg
res db:migrate
(in E:/Work/JRuby/MyApp)
== CreateViews: migrating

Any solution to fix this error?

Thanks,
John

John Ebenezer wrote:

Hi,

I have installed rails_sql_views-0.1.0.gem in jruby\bin directory.

I referred this link
http://activewarehouse.rubyforge.org/rails_sql_views/
to create a database view

Code to create a view

class CreateViews < ActiveRecord::Migration
  def self.up
  create_view(:v_photo, "select description, content_type from photo")
do |t|
        t.column :description
        t.column :content_type
      end
  end

  def self.down
  drop_view(:v_photo)
  end
end

I got the view created successfully, and also got this error

E:\Work\JRuby\MyApp>jruby --command rake environment
RAILS_ENV=development_postg
res db:migrate
(in E:/Work/JRuby/MyApp)
== CreateViews: migrating

-- create_view(:v_photo, "select description, content_type from photo")
   -> 0.7830s
== CreateViews: migrated (0.7830s)

rake aborted!
undefined method `views' for
#<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1 ....

.............