Sha256: 7774b49281f9186c17c3b072e599f61310536bb759a373a969b7c27861a3721e

Contents?: true

Size: 559 Bytes

Versions: 25

Compression:

Stored size: 559 Bytes

Contents

module Jobshop
  module Generators
    module OrmHelpers
      private

      def model_exists?
        File.exist?(File.join(destination_root, model_path))
      end

      def migration_exists?(table_name)
        Dir.glob("#{File.join(destination_root, migration_path)}/[0-9]*_*.rb").grep(/\d+_add_jobshop_to_#{table_name}.rb$/).first
      end

      def migration_path
        @migration_path ||= File.join("db", "migrate")
      end

      def model_path
        @model_path ||= File.join("app", "models", "#{file_path}.rb")
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
jobshop-0.0.179 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.167 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.163 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.157 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.131 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.127 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.113 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.109 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.107 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.101 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.67 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.61 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.59 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.53 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.41 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.37 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.29 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.23 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.16 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.15 lib/generators/jobshop/orm_helpers.rb