Sha256: 4774dea3196d613af2b74c75d42614e5b1f9d641635b146010eb284af0b1f4a1

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 Bytes

Contents

module Support
  class << self
    def get_model from
      Object.const_get(:"#{from.humanize}")
    end
    
    def file_tab model_name,*args,&block
      from=Support.get_model(model_name)
      Lolita::Configuration::FilesTab.new(from.lolita.dbi,*args,&block)
    end

    def get_file(filename)
      File.open(File.expand_path("test_orm/files/"+filename.to_s))
    end

    def load_rails_application
      require 'rails'
      require 'lolita/rails/all'
      require 'lolita-file-upload/rails'
      require File.expand_path("test_orm/rails/config/enviroment")
    end
  end
end

at_exit do
  FileUtils.rm_rf(File.expand_path("uploads"))
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lolita-file-upload-0.2.1 test_orm/support.rb
lolita-file-upload-0.2.0 test_orm/support.rb