Is there a way to have Sequel return models instead of a hash for raw sql?
class Post < Sequel::Model
def self.recent
db["some sql goes here"].all #would like models returned here instead
end
end
Hope it makes sense.
Is there a way to have Sequel return models instead of a hash for raw sql?
class Post < Sequel::Model
def self.recent
db["some sql goes here"].all #would like models returned here instead
end
end
Hope it makes sense.
class Post < Sequel::Model
def self.recent
with_sql("some sql goes here").all
end
end