lib/generators/logidze/model/model_generator.rb
# Convenience method for formatting pg arguments.
# Some examples:
# format_pgsql_args('a', 'b', nil) #=> "a, b"
# format_pgsql_args(nil, '', 'c')  #=> "null, null, c"
# format_pgsql_args('a', '', [])   #=> "a"
Convenience method for formatting pg arguments.
Convenience method for formatting pg arguments .
def format_pgsql_args(*values)
          args = []
          values.reverse_each do |value|
            formatted_value = value.presence || (args.any? && 'null')
            args << formatted_value if formatted_value
          end
          args.compact.reverse.join(', ')
        end
def format_pgsql_args ( * values ) args = [ ] values . reverse_each do | value | formatted_value = value . presence || ( args . any? && 'null' ) args << formatted_value if formatted_value end args . compact . reverse . join ( ', ' ) end
Convenience method for formatting pg arguments.
Convenience method for formatting pg arguments .
values
<not_specific>