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

Whitespace and sort order for Dumper Middleware #3

Merged
merged 1 commit into from
Jan 16, 2016
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
4 changes: 2 additions & 2 deletions lib/schema_plus/enums/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module Initial
module Postgresql

def after(env)
env.connection.enums.each do |schema, name, values|
env.connection.enums.sort_by {|k| k[1] }.each do |schema, name, values|
params = [name.inspect]
params << values.map(&:inspect).join(', ')
params << ":schema => #{schema.inspect}" if schema != 'public'

env.initial << "create_enum #{params.join(', ')}"
env.initial << " create_enum #{params.join(', ')}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we would ever have more than one level of nesting on Initial and whether this should be evaluated to account for that possibility?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't worried about that so far :)

end
end
end
Expand Down