1
是否有能力定義與Rails ActiveRecord
類似的示波器?如何在Datamapper中正確定義示波器
是否有能力定義與Rails ActiveRecord
類似的示波器?如何在Datamapper中正確定義示波器
http://datamapper.org/docs/find.html
class Zoo
# all the keys and property setup here
def self.open
all(:open => true)
end
def self.big
all(:animal_count => 1000)
end
end
big_open_zoos = Zoo.big.open
所以沒有什麼特別的範圍,只是紅寶石。
謝謝!我是Datamapper的新手。 還有一個問題:例如我有一個表,我需要通過Column2的參數來獲取某個column1。 通過你的方法我會得到一些對象,但有沒有辦法獲得某些值的數組。 (我的意思是有辦法執行一個「輕」查詢不要獲取不必要的數據) – user1136228 2012-03-25 14:08:25
因此,問一個新的問題。 – Reactormonk 2012-03-25 14:32:45