Skip to content

Commit

Permalink
Make create_view with a dataset work with the pg_auto_parameterize ex…
Browse files Browse the repository at this point in the history
…tension

Automatic parameterization should be turned off, since the query is
not executed like a normal query.
  • Loading branch information
jeremyevans committed Jan 28, 2013
1 parent 0049b09 commit 045030a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/sequel/extensions/pg_auto_parameterize.rb
Expand Up @@ -102,6 +102,15 @@ def execute(sql, opts={})
end
super
end

private

def create_view_sql(name, source, options)
if source.is_a?(DatasetMethods)
source = source.no_auto_parameterize
end
super
end
end

module DatasetMethods
Expand Down

0 comments on commit 045030a

Please sign in to comment.