Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow schema and table to have the same name #16

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/CommentCollector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Representation of a parsed comment for a database object
#
class CommentItem
attr_accessor :identifier_noschema, :schema, :arguments, :arguments_nodefault
attr_accessor :identifier_noschema, :schema, :object, :arguments, :arguments_nodefault
attr_accessor :full_comment, :parsed_comment
attr_accessor :params, :columns
attr_accessor :returns, :see, :todo, :file
Expand All @@ -15,7 +15,7 @@ def initialize
end

def identifier
if @schema == '' || @schema == @identifier_noschema then
if @schema == '' || @object == 'SCHEMA' then
@identifier_noschema
else
@schema + '.' + @identifier_noschema
Expand Down Expand Up @@ -160,6 +160,7 @@ def self.fix_wrapping(comment_lines)

def self.create_comment_item(object, identifier, arguments)
comment_item = CommentItem.new
comment_item.object = object
comment_item.identifier_noschema = identifier.include?('.') ? identifier.split('.')[1] : identifier
comment_item.schema = identifier.include?('.') ? identifier.split('.')[0] : ''
comment_item.schema = identifier if object == 'SCHEMA'
Expand Down