Skip to content

Commit

Permalink
Supress 'pg_catalog' from QualifiedName#to_s. Fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvle Putnam committed Aug 13, 2011
1 parent ed4f528 commit 6d6edcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/piggly/dumper/qualified_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(name, *names)
end

def shorten
self.class.new(@names.last)
self.class.new(*@names.slice(1..-1))
end

# @return [String]
Expand All @@ -23,7 +23,11 @@ def schema

# @return [String]
def to_s
@names.join(".")
if schema == "pg_catalog"
@names.slice(1..-1).join(".")
else
@names.join(".")
end
end

def ==(qn)
Expand Down
2 changes: 1 addition & 1 deletion lib/piggly/dumper/skeleton_procedure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(oid, name, strict, secdef, setof, type, volatility, arg_modes, ar
# @return [String]
def arguments
@arg_types.zip(@arg_names, @arg_modes).map do |type, name, mode|
"#{mode + " " if mode}#{name.quote + " " if name}#{type.shorten}"
"#{mode + " " if mode}#{name.quote + " " if name}#{type}"
end.join(", ")
end

Expand Down

0 comments on commit 6d6edcb

Please sign in to comment.