lib/pg_trunk/core/operation.rb
# Helper to read a versioned snippet for a specific
# kind of objects
Helper to read a versioned snippet for a specific
kind of objects
Helper to read a versioned snippet for a specific kind of objects
def read_snippet_from(kind)
      return if kind.blank? || name.blank? || version.blank?
      filename = format(
        "db/%<kind>s/%<name>s_v%<version>02d.sql",
        kind: kind.to_s.pluralize,
        name: name.routine,
        version: version,
      )
      filepath = Rails.root.join(filename)
      File.read(filepath).sub(/;\s*$/, "")
    end
def read_snippet_from ( kind ) return if kind . blank? || name . blank? || version . blank? filename = format ( "db/%<kind>s/%<name>s_v%<version>02d.sql" , kind : kind . to_s . pluralize , name : name . routine , version : version , ) filepath = Rails . root . join ( filename ) File . read ( filepath ) . sub ( / ; \s *$ / , "" ) end
Helper to read a versioned snippet for a specific
kind of objects
Helper to read a versioned snippet for a specific kind of objects
kind
<not_specific>