Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sequel plugin to override default select_append behaviour which adds '*' to select query if there is no prior selections
module Sequel::Plugins::SelectAppendNoDefaultAll
module DatasetMethods
def select_append(*columns, &block)
cur_sel = @opts[:select]
return select(*columns, &block) if !cur_sel || cur_sel.empty?
select(*(cur_sel + columns), &block)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment