1

我在 Sequel 中制作了一个表格视图,并将其放入一个文件中db_views.rb

require 'db_manip'    
Db_manip::DB.create_view(:bn_view,'SELECT ...')

为了遵循“胖模型瘦控制器”的做法,我想为:bn_view.

4

1 回答 1

3

你有没有尝试过:

class BnView < Sequel::Model(:bn_view)
  def foo
    # implement your method here
  end
end
于 2011-12-24T18:54:27.637 回答