Sha256: a84a9ec402b80428c2709e0818912dbca6182bcf3babf002bff8fef3ec76c808

Contents?: true

Size: 712 Bytes

Versions: 18

Compression:

Stored size: 712 Bytes

Contents

require "rails/generators/base"

module PgSearch
  module Migration
    class AssociatedAgainstGenerator < Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      def create_migration
        now = Time.now.utc
        filename = "#{now.strftime('%Y%m%d%H%M%S')}_add_pg_search_associated_against_support_functions.rb"
        template "add_pg_search_associated_against_support_functions.rb.erb", "db/migrate/#{filename}"
      end

      private

      def read_sql_file(filename)
        sql_directory = File.expand_path("../../../../sql", __FILE__)
        source_path = File.join(sql_directory, "#{filename}.sql")
        File.read(source_path)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pg_search-0.7.4 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.7.3 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.7.2 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.7.1 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.7.0 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.6.4 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.6.3 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.6.2 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.6.1 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.6.0 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.7 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.6 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.5 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.4 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.3 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.2 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5.1 lib/pg_search/migration/associated_against_generator.rb
pg_search-0.5 lib/pg_search/migration/associated_against_generator.rb