Sha256: e214fc633818215a638f84b35b76a9e1a7eeac8e35c31cf1455beea2596ce00a

Contents?: true

Size: 728 Bytes

Versions: 3

Compression:

Stored size: 728 Bytes

Contents

module Coalla
  module Cms
    module Utils
      module Orm
        def model_contents
          <<-CONTENT
  devise :database_authenticatable, :rememberable, :validatable
          CONTENT
        end

        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_admin_role_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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coalla-cms-0.7.0.0 lib/generators/coalla/cms/utils/orm.rb
coalla-cms-0.6.1.1 lib/generators/coalla/cms/utils/orm.rb
coalla-cms-0.6.0.9 lib/generators/coalla/cms/utils/orm.rb