提交 bfe03488 编写于 作者: A Aaron Patterson

table responds to where, column info is cached

上级 38b10d5e
......@@ -6,16 +6,21 @@ class << self; attr_accessor :engine; end
attr_reader :name, :engine
def initialize name, engine = Table.engine
@name = name
@engine = engine
@name = name
@engine = engine
@columns = nil
end
def tm
TreeManager.new(@engine).from(self)
end
def where condition
tm.where condition
end
def columns
@engine.connection.columns(@name, "#{@name} Columns").map do |column|
@columns ||= @engine.connection.columns(@name, "#{@name} Columns").map do |column|
Attributes.for(column).new self, column.name, column
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册