Sha256: 01b74a6b39373ed8e50b48328ebbedc79a41a8639470ddba39c02c7945e3a463

Contents?: true

Size: 560 Bytes

Versions: 19

Compression:

Stored size: 560 Bytes

Contents

module Jobshop
  module Generators
    module OrmHelpers
      private

      def model_exists?
        File.exists?(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

19 entries across 19 versions & 1 rubygems

Version Path
jobshop-0.0.9 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.7 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.6 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.5 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.4.2p4 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.4.1p4 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.4.0p13 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.4.0p1 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.3.1 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.3.0 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.6 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.5 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.4 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.3 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.2 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2.1 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.2 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.1 lib/generators/jobshop/orm_helpers.rb
jobshop-0.0.0 lib/generators/jobshop/orm_helpers.rb